OpenCloudOS-Kernel/drivers/net/dsa/sja1105
Vladimir Oltean b0b33b048d net: dsa: sja1105: fix address learning getting disabled on the CPU port
In May 2019 when commit 640f763f98 ("net: dsa: sja1105: Add support
for Spanning Tree Protocol") was introduced, the comment that "STP does
not get called for the CPU port" was true. This changed after commit
0394a63acf ("net: dsa: enable and disable all ports") in August 2019
and went largely unnoticed, because the sja1105_bridge_stp_state_set()
method did nothing different compared to the static setup done by
sja1105_init_mac_settings().

With the ability to turn address learning off introduced by the blamed
commit, there is a new priv->learn_ena port mask in the driver. When
sja1105_bridge_stp_state_set() gets called and we are in
BR_STATE_LEARNING or later, address learning is enabled or not depending
on priv->learn_ena & BIT(port).

So what happens is that priv->learn_ena is not being set from anywhere
for the CPU port, and the static configuration done by
sja1105_init_mac_settings() is being overwritten.

To solve this, acknowledge that the static configuration of STP state is
no longer necessary because the STP state is being set by the DSA core
now, but what is necessary is to set priv->learn_ena for the CPU port.

Fixes: 4d94235495 ("net: dsa: sja1105: offload bridge port flags to device")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-13 09:32:41 -07:00
..
Kconfig net: dsa: sja1105: document the SJA1110 in the Kconfig 2021-06-24 12:55:57 -07:00
Makefile net: dsa: sja1105: register the MDIO buses for 100base-T1 and 100base-TX 2021-06-08 14:37:16 -07:00
sja1105.h net: dsa: sja1105: properly power down the microcontroller clock for SJA1110 2021-06-18 12:26:17 -07:00
sja1105_clocking.c net: dsa: sja1105: properly power down the microcontroller clock for SJA1110 2021-06-18 12:26:17 -07:00
sja1105_devlink.c net: dsa: propagate extack to .port_vlan_filtering 2021-02-14 17:38:12 -08:00
sja1105_dynamic_config.c net: dsa: sja1105: fix dynamic access to L2 Address Lookup table for SJA1110 2021-06-28 15:49:05 -07:00
sja1105_dynamic_config.h net: dsa: sja1105: add support for the SJA1110 switch family 2021-06-08 14:37:16 -07:00
sja1105_ethtool.c net: dsa: sja1105: don't use burst SPI reads for port statistics 2021-05-21 14:01:41 -07:00
sja1105_flower.c net: dsa: sja1105: dimension the data structures for a larger port count 2021-05-24 13:59:03 -07:00
sja1105_main.c net: dsa: sja1105: fix address learning getting disabled on the CPU port 2021-07-13 09:32:41 -07:00
sja1105_mdio.c net: dsa: sja1105: plug in support for 2500base-x 2021-06-11 13:43:56 -07:00
sja1105_ptp.c net: dsa: sja1105: implement TX timestamping for SJA1110 2021-06-11 12:45:38 -07:00
sja1105_ptp.h net: dsa: sja1105: implement TX timestamping for SJA1110 2021-06-11 12:45:38 -07:00
sja1105_spi.c net: dsa: sja1105: properly power down the microcontroller clock for SJA1110 2021-06-18 12:26:17 -07:00
sja1105_static_config.c net: dsa: sja1105: allow the TTEthernet configuration in the static config for SJA1110 2021-06-18 12:26:17 -07:00
sja1105_static_config.h net: dsa: add support for the SJA1110 native tagging protocol 2021-06-11 12:45:38 -07:00
sja1105_tas.c net: dsa: sja1105: parameterize the number of ports 2021-05-24 13:59:03 -07:00
sja1105_tas.h net: dsa: sja1105: dimension the data structures for a larger port count 2021-05-24 13:59:03 -07:00
sja1105_vl.c net: dsa: sja1105: dimension the data structures for a larger port count 2021-05-24 13:59:03 -07:00
sja1105_vl.h net: dsa: sja1105: suppress -Wmissing-prototypes in sja1105_vl.c 2020-06-01 12:13:47 -07:00