* [PATCH net] net: dsa: qca8k: Fix port enable for CPU port
@ 2019-09-25 0:47 Andrew Lunn
2019-09-25 7:06 ` Michal Vokáč
2019-09-27 8:32 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Andrew Lunn @ 2019-09-25 0:47 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Vivien Didelot, michal.vokac, 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.
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>
---
drivers/net/dsa/qca8k.c | 3 +++
1 file changed, 3 insertions(+)
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;
--
2.23.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] net: dsa: qca8k: Fix port enable for CPU port
2019-09-25 0:47 [PATCH net] net: dsa: qca8k: Fix port enable for CPU port Andrew Lunn
@ 2019-09-25 7:06 ` Michal Vokáč
2019-09-27 8:32 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Michal Vokáč @ 2019-09-25 7:06 UTC (permalink / raw)
To: Andrew Lunn, David Miller; +Cc: netdev, Vivien Didelot
On 25. 09. 19 2:47, Andrew Lunn wrote:
> 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>
Thank you for the prompt fix Andrew!
Tested-by: Michal Vokáč <michal.vokac@ysoft.com>
> Fixes: 0394a63acfe2 ("net: dsa: enable and disable all ports")
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
> drivers/net/dsa/qca8k.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> 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;
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] net: dsa: qca8k: Fix port enable for CPU port
2019-09-25 0:47 [PATCH net] net: dsa: qca8k: Fix port enable for CPU port Andrew Lunn
2019-09-25 7:06 ` Michal Vokáč
@ 2019-09-27 8:32 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-09-27 8:32 UTC (permalink / raw)
To: andrew; +Cc: netdev, vivien.didelot, michal.vokac
From: Andrew Lunn <andrew@lunn.ch>
Date: Wed, 25 Sep 2019 02:47:07 +0200
> 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>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-27 8:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-25 0:47 [PATCH net] net: dsa: qca8k: Fix port enable for CPU port Andrew Lunn
2019-09-25 7:06 ` Michal Vokáč
2019-09-27 8:32 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox