[PATCH net-next] net: dsa: unregister cross-chip notifier after ds->ops->teardown

Subsystems: networking [dsa], networking [general], the rest

STALE1772d LANDED

Landed in mainline as 39e222bfd7f3 on 2021-10-13.

2 messages, 2 authors, 2021-10-13 · open the first message on its own page

[PATCH net-next] net: dsa: unregister cross-chip notifier after ds->ops->teardown

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2021-10-12 12:39:14

To be symmetric with the error unwind path of dsa_switch_setup(), call
dsa_switch_unregister_notifier() after ds->ops->teardown.

The implication is that ds->ops->teardown cannot emit cross-chip
notifiers. For example, currently the dsa_tag_8021q_unregister() call
from sja1105_teardown() does not propagate to the entire tree due to
this reason. However I cannot find an actual issue caused by this,
observed using code inspection.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/dsa/dsa2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 58f7dce0652c..4f92b1042dd3 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -948,11 +948,11 @@ static void dsa_switch_teardown(struct dsa_switch *ds)
 		ds->slave_mii_bus = NULL;
 	}
 
-	dsa_switch_unregister_notifier(ds);
-
 	if (ds->ops->teardown)
 		ds->ops->teardown(ds);
 
+	dsa_switch_unregister_notifier(ds);
+
 	if (ds->devlink) {
 		list_for_each_entry(dp, &ds->dst->ports, list)
 			if (dp->ds == ds)
-- 
2.25.1

Re: [PATCH net-next] net: dsa: unregister cross-chip notifier after ds->ops->teardown

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-10-13 20:40:10

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski [off-list ref]:

On Tue, 12 Oct 2021 15:37:35 +0300 you wrote:
To be symmetric with the error unwind path of dsa_switch_setup(), call
dsa_switch_unregister_notifier() after ds->ops->teardown.

The implication is that ds->ops->teardown cannot emit cross-chip
notifiers. For example, currently the dsa_tag_8021q_unregister() call
from sja1105_teardown() does not propagate to the entire tree due to
this reason. However I cannot find an actual issue caused by this,
observed using code inspection.

[...]
Here is the summary with links:
  - [net-next] net: dsa: unregister cross-chip notifier after ds->ops->teardown
    https://git.kernel.org/netdev/net-next/c/39e222bfd7f3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help