Thread (33 messages) 33 messages, 4 authors, 2025-06-03

Re: [RFC PATCH 05/10] net: dsa: b53: prevent DIS_LEARNING access on BCM5325

From: Vladimir Oltean <olteanv@gmail.com>
Date: 2025-06-02 09:40:22
Also in: lkml

On Sat, May 31, 2025 at 12:13:03PM +0200, Álvaro Fernández Rojas wrote:
quoted hunk ↗ jump to hunk
BCM5325 doesn't implement DIS_LEARNING register so we should avoid reading
or writing it.

Fixes: f9b3827ee66c ("net: dsa: b53: Support setting learning on port")
Signed-off-by: Álvaro Fernández Rojas <redacted>
---
 drivers/net/dsa/b53/b53_common.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 6b2ad82aa95f..9667d4107139 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -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, &reg);
 	if (learning)
 		reg &= ~BIT(port);
-- 
2.39.5
I think if this switch family has that limitation, you should also patch
b53_br_flags_pre() to not permit BR_LEARNING in flags.val, and return
-EINVAL in that case. Otherwise, the "ip link set swp0 type bridge_slave
learning off" command will go through.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help