]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: dsa: b53: fix resetting speed and pause on forced link
authorJonas Gorski <jonas.gorski@gmail.com>
Sat, 1 Nov 2025 13:28:06 +0000 (14:28 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 4 Nov 2025 00:40:35 +0000 (16:40 -0800)
commitb6a8a5477fe9bd6be2b594a88f82f8bba41e6d54
treecf44dd7e3e77d5e242485ed0b3d5fc87ea70a0cd
parent7ed8b63ddc9a9578eae81f4da32761568a25efad
net: dsa: b53: fix resetting speed and pause on forced link

There is no guarantee that the port state override registers have their
default values, as not all switches support being reset via register or
have a reset GPIO.

So when forcing port config, we need to make sure to clear all fields,
which we currently do not do for the speed and flow control
configuration. This can cause flow control stay enabled, or in the case
of speed becoming an illegal value, e.g. configured for 1G (0x2), then
setting 100M (0x1), results in 0x3 which is invalid.

For PORT_OVERRIDE_SPEED_2000M we need to make sure to only clear it on
supported chips, as the bit can have different meanings on other chips,
e.g. for BCM5389 this controls scanning PHYs for link/speed
configuration.

Fixes: 5e004460f874 ("net: dsa: b53: Add helper to set link parameters")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20251101132807.50419-2-jonas.gorski@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/b53/b53_common.c