Skip to contentSkip to conversation

net: dsa: qca8k: Fix port enable for CPU port

PATCH Applied Andrew Lunn 3 participants 3 messages Sep 25, 2019 – Sep 27, 2019

Subsystems (3)
lore
Share & tools
lore

Andrew Lunn

author maintainer
#0 lore raw

PATCH 1/1 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.

Fixes 0394a63acfe2 ("net: dsa: enable and disable all ports")
---
 drivers/net/dsa/qca8k.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/dsa/qca8k.c +3 -0
index 16f15c93a102..684aa51684db 100644
@@ -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;
 
Signature · 1 line
2.23.0
Tested-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andrew Lunn

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.

Thank you for the prompt fix Andrew!

Quoted 21 lines
Fixes 0394a63acfe2 ("net: dsa: enable and disable all ports")
---
  drivers/net/dsa/qca8k.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/net/dsa/qca8k.c +3 -0
index 16f15c93a102..684aa51684db 100644
@@ -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;
 
maintainer Applied
#2 lore raw
In reply to Andrew Lunn

From: Andrew Lunn <[email protected]>
Date: Wed, 25 Sep 2019 02:47:07 +0200

Quoted 7 lines

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.

Fixes 0394a63acfe2 ("net: dsa: enable and disable all ports")

Applied.