From: Andrew Lunn Date: Wed, 25 Sep 2019 00:47:07 +0000 (+0200) Subject: net: dsa: qca8k: Fix port enable for CPU port X-Git-Tag: v5.4-rc1~14^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b6fd3ea438c742d162a40a124b0181922633163;p=platform%2Fkernel%2Flinux-rpi.git net: dsa: qca8k: Fix port enable for CPU port The CPU port does not have a PHY connected to it. So calling phy_support_asym_pause() results in an Opps. As with other DSA drivers, add a guard that the port is a user port. Reported-by: Michal Vokáč Fixes: 0394a63acfe2 ("net: dsa: enable and disable all ports") Signed-off-by: Andrew Lunn Tested-by: Michal Vokáč Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 16f15c9..684aa51 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -936,6 +936,9 @@ qca8k_port_enable(struct dsa_switch *ds, int port, { struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; + if (!dsa_is_user_port(ds, port)) + return 0; + qca8k_port_set_status(priv, port, 1); priv->port_sts[port].enabled = 1;