Skip to content

Commit

Permalink
net: dsa: qca8k: Fix port enable for CPU port
Browse files Browse the repository at this point in the history
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: 0394a63 ("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>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Sep 27, 2019
1 parent 159d2c7 commit 2b6fd3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/dsa/qca8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2b6fd3e

Please sign in to comment.