[PATCH net-next v4 3/8] net: dsa: motorcomm: Reset port flags on bridge leaving

From: David Yang

Date: Sat Nov 07 2026 - 07:19:06 EST


DSA does not clear BR_HAIRPIN_MODE and BR_ISOLATED when a port leaves
a bridge, so the cached flags survive into the next bridge join and
program stale hairpin and port isolation state.

Reset them when leaving the bridge.

Signed-off-by: David Yang <mmyangfl@xxxxxxxxx>
---
drivers/net/dsa/motorcomm/chip.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
index 47f06945b8c4..c51491ef4dae 100644
--- a/drivers/net/dsa/motorcomm/chip.c
+++ b/drivers/net/dsa/motorcomm/chip.c
@@ -1158,10 +1158,17 @@ yt921x_dsa_port_vlan_add(struct dsa_switch *ds, int port,

static int yt921x_userport_standalone(struct yt921x_priv *priv, int port)
{
+ struct yt921x_port *pp = &priv->ports[port];
u32 mask;
u32 ctrl;
int res;

+ /* The return value got ignored by DSA core, reset flags before touching
+ * the hardware.
+ */
+ pp->hairpin = false;
+ pp->isolated = false;
+
ctrl = ~priv->cpu_ports_mask;
res = yt921x_reg_write(priv, YT921X_PORTn_ISOLATION(port), ctrl);
if (res)
--
2.53.0