* [PATCH net] net: dsa: felix: don't deinitialize unused ports
@ 2021-02-16 11:14 Vladimir Oltean
2021-02-16 22:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2021-02-16 11:14 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, netdev
Cc: Andrew Lunn, Florian Fainelli, Vivien Didelot, Claudiu Manoil,
Alexandre Belloni, UNGLinuxDriver
From: Vladimir Oltean <vladimir.oltean@nxp.com>
ocelot_init_port is called only if dsa_is_unused_port == false, however
ocelot_deinit_port is called unconditionally. This causes a warning in
the skb_queue_purge inside ocelot_deinit_port saying that the spin lock
protecting ocelot_port->tx_skbs was not initialized.
Fixes: e5fb512d81d0 ("net: mscc: ocelot: deinitialize only initialized ports")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/dsa/ocelot/felix.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 800f27d65c6c..3e72f0a79918 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -1262,8 +1262,12 @@ static void felix_teardown(struct dsa_switch *ds)
ocelot_deinit_timestamp(ocelot);
ocelot_deinit(ocelot);
- for (port = 0; port < ocelot->num_phys_ports; port++)
+ for (port = 0; port < ocelot->num_phys_ports; port++) {
+ if (dsa_is_unused_port(ds, port))
+ continue;
+
ocelot_deinit_port(ocelot, port);
+ }
if (felix->info->mdio_bus_free)
felix->info->mdio_bus_free(ocelot);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: dsa: felix: don't deinitialize unused ports
2021-02-16 11:14 [PATCH net] net: dsa: felix: don't deinitialize unused ports Vladimir Oltean
@ 2021-02-16 22:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-16 22:10 UTC (permalink / raw)
To: Vladimir Oltean
Cc: davem, kuba, netdev, andrew, f.fainelli, vivien.didelot,
claudiu.manoil, alexandre.belloni, UNGLinuxDriver
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Tue, 16 Feb 2021 13:14:46 +0200 you wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> ocelot_init_port is called only if dsa_is_unused_port == false, however
> ocelot_deinit_port is called unconditionally. This causes a warning in
> the skb_queue_purge inside ocelot_deinit_port saying that the spin lock
> protecting ocelot_port->tx_skbs was not initialized.
>
> [...]
Here is the summary with links:
- [net] net: dsa: felix: don't deinitialize unused ports
https://git.kernel.org/netdev/net-next/c/42b5adbbac03
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-16 22:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 11:14 [PATCH net] net: dsa: felix: don't deinitialize unused ports Vladimir Oltean
2021-02-16 22:10 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.