Skip to content

Commit 6f268e2

Browse files
KanjiMonsterkuba-moo
authored andcommitted
net: dsa: b53: fix VLAN_ID_IDX write size for BCM5325/65
Since BCM5325 and BCM5365 only support up to 256 VLANs, the VLAN_ID_IDX register is only 8 bit wide, not 16 bit, so use an appropriate accessor. Fixes: c456553 ("net: dsa: b53: add support for FDB operations on 5325/5365") Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Álvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Link: https://patch.msgid.link/20251128080625.27181-2-jonas.gorski@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 4e3583c commit 6f268e2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/net/dsa/b53/b53_common.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,8 +1966,12 @@ static int b53_arl_op(struct b53_device *dev, int op, int port,
19661966

19671967
/* Perform a read for the given MAC and VID */
19681968
b53_write48(dev, B53_ARLIO_PAGE, B53_MAC_ADDR_IDX, mac);
1969-
if (!is5325m(dev))
1970-
b53_write16(dev, B53_ARLIO_PAGE, B53_VLAN_ID_IDX, vid);
1969+
if (!is5325m(dev)) {
1970+
if (is5325(dev) || is5365(dev))
1971+
b53_write8(dev, B53_ARLIO_PAGE, B53_VLAN_ID_IDX, vid);
1972+
else
1973+
b53_write16(dev, B53_ARLIO_PAGE, B53_VLAN_ID_IDX, vid);
1974+
}
19711975

19721976
/* Issue a read operation for this MAC */
19731977
ret = b53_arl_rw_op(dev, 1);

0 commit comments

Comments
 (0)