Re: [PATCH net v5 5/8] net: dsa: b53: use the correct override register 2 Gbps bit

From: netdev-bot+sashiko

Date: Mon Nov 16 2026 - 14:03:38 EST


Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The Fixes: tag covers only one of the two bugs this patch fixes.

--

net: dsa: b53: use the correct override register 2 Gbps bit

This patch picks the 2 Gbps speed bit per register in
b53_force_port_config(). The IMP override register uses
PORT_OVERRIDE_SPEED_2000M and the per-port GMII override registers use
GMII_PO_SPEED_2000M. As a result, lower speeds clear the correct bit and
2 Gbps sets the correct bit on GMII ports.

> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
> index 64e04c5731a69..d8dafa9e0c44d 100644
> --- a/drivers/net/dsa/b53/b53_common.c
> +++ b/drivers/net/dsa/b53/b53_common.c

[ ... ]

> @@ -1449,11 +1451,12 @@ static void b53_force_port_config(struct b53_device *dev, int port,
>
> reg &= ~(0x3 << GMII_PO_SPEED_S);
> if (is5301x(dev) || is58xx(dev))
> - reg &= ~PORT_OVERRIDE_SPEED_2000M;
> + reg &= ~speed2000;
>
> switch (speed) {
> case 2000:
> - reg |= PORT_OVERRIDE_SPEED_2000M;
> + if (is5301x(dev) || is58xx(dev))
> + reg |= speed2000;
> fallthrough;

[Severity: Low]
This isn't a bug, but should the Fixes: tag also cover the 2 Gbps set
path? The commit message has:

Fixes: b6a8a5477fe9 ("net: dsa: b53: fix resetting speed and pause on forced link")

b6a8a5477fe9 added the clear of PORT_OVERRIDE_SPEED_2000M at lower speeds.
On the GMII register that clear removes GMII_PO_EN (BIT(6)) and leaves a
stale GMII_PO_SPEED_2000M behind. That part of the patch matches the tag.

The change in case 2000 fixes an older problem. On a GMII port, ORing in
PORT_OVERRIDE_SPEED_2000M has always set GMII_PO_EN and never
GMII_PO_SPEED_2000M (BIT(7)), so 2 Gbps was never selected on that
register.

The case 2000 line goes back to 967dd82ffc52. Later, 63f8428b4077 switched
the code from cpu_port to imp_port, which moved BCM5301x CPU port 5 back
onto the GMII register path, and that path still set BIT(6).

In the current tree, the only caller that passes speed = 2000 is
b53_phylink_mac_link_up():

if ((is5301x(dev) || dev->chip_id == BCM58XX_DEVICE_ID) &&
dsa_is_cpu_port(ds, port)) {
tx_pause = true;
rx_pause = true;
speed = 2000;
}

That code came from 41af38324341 ("net: dsa: b53: restore the NSP IMP port
2 Gbps mode"). It also covers BCM5301x CPU ports 5 and 7, which go through
B53_GMII_PORT_OVERRIDE_CTRL(port).

The commit message says the patch makes it so "2 Gbps sets it". Would an
extra Fixes: tag for 41af38324341 describe what the patch fixes more
accurately?

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112180202.324504-1-florian.fainelli%40broadcom.com