Skip to content

Commit

Permalink
net: dsa: sja1105: fix configuration of source address learning
Browse files Browse the repository at this point in the history
Due to a mistake, the driver always sets the address learning flag to
the previously stored value, and not to the currently configured one.
The bug is visible only in standalone ports mode, because when the port
is bridged, the issue is masked by .port_stp_state_set which overwrites
the address learning state to the proper value.

Fixes: 4d94235 ("net: dsa: sja1105: offload bridge port flags to device")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Feb 16, 2021
1 parent 786621d commit 4c44fc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dsa/sja1105/sja1105_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3287,7 +3287,7 @@ static int sja1105_port_set_learning(struct sja1105_private *priv, int port,

mac = priv->static_config.tables[BLK_IDX_MAC_CONFIG].entries;

mac[port].dyn_learn = !!(priv->learn_ena & BIT(port));
mac[port].dyn_learn = enabled;

rc = sja1105_dynamic_config_write(priv, BLK_IDX_MAC_CONFIG, port,
&mac[port], true);
Expand Down

0 comments on commit 4c44fc5

Please sign in to comment.