Remove a pair of ports from the port matrix when both ports have the
isolated flag set.
Signed-off-by: Matthias Schiffer <mschiffer@xxxxxxxxxxxxxxxxxxxx>
---
drivers/net/dsa/mt7530.c | 21 ++++++++++++++++++---
drivers/net/dsa/mt7530.h | 1 +
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index ecacaefdd694..44939379aba8 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1303,7 +1303,8 @@ mt7530_stp_state_set(struct dsa_switch *ds, int port, u8 state)
}
static void mt7530_update_port_member(struct mt7530_priv *priv, int port,
- const struct net_device *bridge_dev, bool join)
+ const struct net_device *bridge_dev,
+ bool join)
__must_hold(&priv->reg_mutex)
{
struct dsa_port *dp = dsa_to_port(priv->ds, port), *other_dp;
@@ -1311,6 +1312,7 @@ static void mt7530_update_port_member(struct mt7530_priv *priv, int port,
struct dsa_port *cpu_dp = dp->cpu_dp;
u32 port_bitmap = BIT(cpu_dp->index);
int other_port;
+ bool isolated;
dsa_switch_for_each_user_port(other_dp, priv->ds) {
other_port = other_dp->index;
@@ -1327,7 +1329,9 @@ static void mt7530_update_port_member(struct mt7530_priv *priv, int port,
if (!dsa_port_offloads_bridge_dev(other_dp, bridge_dev))
continue;
- if (join) {
+ isolated = p->isolated && other_p->isolated;
+
+ if (join && !isolated) {
other_p->pm |= PCR_MATRIX(BIT(port));
port_bitmap |= BIT(other_port);
} else {