Re: [PATCH V3 1/4 net] net: dsa: b53: deal with Northstar devices using CPU port 5 or 7

Jonas Gorski <[email protected]>
Newsgroups org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.netdev
Message-ID <CAOiHx=ne6o8j2jLWB_R57z_9KFwF=ZMw-2JVWDn6QNYs3CTyag@mail.gmail.com>
Hi,

On Wed, Aug 12, 2026 at 3:28 PM Rafał Miłecki <[email protected]> wrote:
>
> From: Rafał Miłecki <[email protected]>
>
> Northstar devices have 3 CPU ports. Ports 5 and 7 may be used but have
> their limitations. Warn user when CPU port 8 isn't used and add EAP
> setup workaround to avoid non-functional standalone ports.
>
> Fixes: 4227ea91e265 ("net: dsa: b53: prevent standalone from trying to forward to other ports")
> Cc: Semih Baskan <[email protected]>
> Signed-off-by: Rafał Miłecki <[email protected]>
> Tested-by: Semih Baskan <[email protected]>
> ---
> This fixes a regression so it's a net.git material
>
> V2: Print warning on switch setup instead of on actual EAP mode change
> V3: Proper subject prefix & shorter comments (long one comes with 2/2)
>
>  drivers/net/dsa/b53/b53_common.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
> index 3f5b9592794d..5fd8362d0430 100644
> --- a/drivers/net/dsa/b53/b53_common.c
> +++ b/drivers/net/dsa/b53/b53_common.c
> @@ -332,6 +332,14 @@ static void b53_set_eap_mode(struct b53_device *dev, int port, int mode)
>  {
>         u64 eap_conf;
>
> +       /*
> +        * On Northstar setting EAP_MODE_SIMPLIFIED with CPU port 5/7 breaks

This isn't just northstar, this is any dual IMP capable switch

> +        * standalone ports, see:
> +        * https://lore.kernel.org/netdev/[email protected]/
> +        */
> +       if (is5301x(dev) && !dsa_is_cpu_port(dev->ds, B53_CPU_PORT))
> +               return;

This should be moved below the 5325/5365 check and just
!dsa_is_cpu_port(dev->ds, B53_CPU_PORT))

> +
>         if (is5325(dev) || is5365(dev) || dev->chip_id == BCM5389_DEVICE_ID)
>                 return;
>
> @@ -1281,6 +1289,10 @@ static int b53_setup(struct dsa_switch *ds)
>         u16 pvid;
>         int ret;
>
> +       /* Discourage users from using port 5 or 7 due to limited features */
> +       if (is5301x(dev) && !dsa_is_cpu_port(dev->ds, B53_CPU_PORT))

This should be

if (!is5325(dev) && !is5365(dev) && !dsa_is_cpu_port(dev->ds, B53_CPU_PORT))

dual IMP mode is also supported by external switches (e.g. bcm53115
and bcm53125), and if for some reason someone would try to use port 5
only on these you will have the same issues.

> +               dev_warn(dev->dev, "switch to CPU port 8 to use all switch features\n");

I think this warning is too mild; it should be something like

"Using port 5 or 7 as CPU port is not a valid configuration and will
prevent the switch from working properly..\n"

Best regards,
Jonas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.