Thread (9 messages) flat view 9 messages, 4 authors, 2021-09-02

Re: [PATCH net 1/2] net: dsa: b53: Fix calculating number of switch ports

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2021-09-01 17:16:58
Also in: stable


On 9/1/2021 2:21 AM, Rafał Miłecki wrote:
From: Rafał Miłecki <rafal@milecki.pl>

It isn't true that CPU port is always the last one. Switches BCM5301x
have 9 ports (port 6 being inactive) and they use port 5 as CPU by
default (depending on design some other may be CPU ports too).

A more reliable way of determining number of ports is to check for the
last set bit in the "enabled_ports" bitfield.

This fixes b53 internal state, it will allow providing accurate info to
the DSA and is required to fix BCM5301x support.

Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Cc: stable@vger.kernel.org
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
For a bug fix, this looks appropriate to me, and for net-next, we need 
to remove the dev->num_ports and b53_for_each_port() entirely as there 
is no need to duplicate what DSA already maintains for us. Thanks!

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help