mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 06:01:53 +02:00
net: dsa: b53: prevent DIS_LEARNING access on BCM5325
BCM5325 doesn't implement DIS_LEARNING register so we should avoid reading or writing it. Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Link: https://patch.msgid.link/20250614080000.1884236-10-noltari@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
044d5ce278
commit
800728abd9
|
|
@ -593,6 +593,9 @@ static void b53_port_set_learning(struct b53_device *dev, int port,
|
|||
{
|
||||
u16 reg;
|
||||
|
||||
if (is5325(dev))
|
||||
return;
|
||||
|
||||
b53_read16(dev, B53_CTRL_PAGE, B53_DIS_LEARNING, ®);
|
||||
if (learning)
|
||||
reg &= ~BIT(port);
|
||||
|
|
@ -2243,7 +2246,13 @@ int b53_br_flags_pre(struct dsa_switch *ds, int port,
|
|||
struct switchdev_brport_flags flags,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
if (flags.mask & ~(BR_FLOOD | BR_MCAST_FLOOD | BR_LEARNING))
|
||||
struct b53_device *dev = ds->priv;
|
||||
unsigned long mask = (BR_FLOOD | BR_MCAST_FLOOD);
|
||||
|
||||
if (!is5325(dev))
|
||||
mask |= BR_LEARNING;
|
||||
|
||||
if (flags.mask & ~mask)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user