diff options
author | Andrew Lunn <andrew@lunn.ch> | 2019-09-25 02:47:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-09-27 10:30:58 +0200 |
commit | 2b6fd3ea438c742d162a40a124b0181922633163 (patch) | |
tree | 3e21a08a6caf0eae3bcc36cf8a8d91126ea0445b /drivers | |
parent | 159d2c7d8106177bd9a986fd005a311fe0d11285 (diff) | |
download | linux-2b6fd3ea438c742d162a40a124b0181922633163.tar.bz2 |
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áč <michal.vokac@ysoft.com>
Fixes: 0394a63acfe2 ("net: dsa: enable and disable all ports")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/dsa/qca8k.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 16f15c93a102..684aa51684db 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; |