[PATCH net-next v5 6/7] net: dsa: motorcomm: Report inconsistency on bridge join failure
From: David Yang
Date: Sun Nov 08 2026 - 16:49:35 EST
DSA does not send bridge_leave when port_bridge_join fails, so a join
that fails midway leaves the port half configured. Rolling back from the
driver would just issue more register accesses that can fail the same
way. Set an extack message on failure instead.
Signed-off-by: David Yang <mmyangfl@xxxxxxxxx>
---
drivers/net/dsa/motorcomm/chip.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
index 46534127d070..3d4aa79ac026 100644
--- a/drivers/net/dsa/motorcomm/chip.c
+++ b/drivers/net/dsa/motorcomm/chip.c
@@ -1433,6 +1433,11 @@ yt921x_dsa_port_bridge_join(struct dsa_switch *ds, int port,
res = yt921x_bridge_join(priv, port, ports_mask);
mutex_unlock(&priv->reg_lock);
+ /* DSA does not send bridge_leave when join fails */
+ if (res)
+ NL_SET_ERR_MSG_MOD(extack,
+ "Fatal IO error; hardware no longer consistent");
+
return res;
}
--
2.53.0