OpenCloudOS-Kernel/drivers/net/dsa/ocelot
Vladimir Oltean 00fa91bc9c net: dsa: felix: fix tagging protocol changes with multiple CPU ports
When the device tree has 2 CPU ports defined, a single one is active
(has any dp->cpu_dp pointers point to it). Yet the second one is still a
CPU port, and DSA still calls ->change_tag_protocol on it.

On the NXP LS1028A, the CPU ports are ports 4 and 5. Port 4 is the
active CPU port and port 5 is inactive.

After the following commands:

 # Initial setting
 cat /sys/class/net/eno2/dsa/tagging
 ocelot
 echo ocelot-8021q > /sys/class/net/eno2/dsa/tagging
 echo ocelot > /sys/class/net/eno2/dsa/tagging

traffic is now broken, because the driver has moved the NPI port from
port 4 to port 5, unbeknown to DSA.

The problem can be avoided by detecting that the second CPU port is
unused, and not doing anything for it. Further rework will be needed
when proper support for multiple CPU ports is added.

Treat this as a bug and prepare current kernels to work in single-CPU
mode with multiple-CPU DT blobs.

Fixes: adb3dccf09 ("net: dsa: felix: convert to the new .change_tag_protocol DSA API")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220412172209.2531865-1-vladimir.oltean@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2022-04-14 08:52:26 +02:00
..
Kconfig net: dsa: ocelot: felix: utilize shared mscc-miim driver for indirect MDIO access 2021-11-29 13:02:00 +00:00
Makefile net: dsa: seville: build as separate module 2020-09-18 17:52:51 -07:00
felix.c net: dsa: felix: fix tagging protocol changes with multiple CPU ports 2022-04-14 08:52:26 +02:00
felix.h net: dsa: felix: remove prevalidate_phy_mode interface 2022-02-28 11:53:10 +00:00
felix_vsc9959.c net: dsa: felix: suppress -EPROBE_DEFER errors 2022-04-08 20:34:03 -07:00
seville_vsc9953.c net: dsa: felix: remove prevalidate_phy_mode interface 2022-02-28 11:53:10 +00:00