Thread (16 messages) 16 messages, 3 authors, 2025-06-11

Re: [RFC PATCH net-next v2 06/10] net: dsa: b53: prevent BRCM_HDR access on BCM5325

From: Jonas Gorski <jonas.gorski@gmail.com>
Date: 2025-06-04 18:05:42
Also in: lkml

On Tue, Jun 3, 2025 at 10:49 PM Álvaro Fernández Rojas
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
BCM5325 doesn't implement BRCM_HDR register so we should avoid reading or
writing it.

Fixes: b409a9efa183 ("net: dsa: b53: Move Broadcom header setup to b53")
Signed-off-by: Álvaro Fernández Rojas <redacted>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 drivers/net/dsa/b53/b53_common.c | 4 ++++
 1 file changed, 4 insertions(+)

 v2: no changes.
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 143c213a1992c..693a44150395e 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -729,6 +729,10 @@ void b53_brcm_hdr_setup(struct dsa_switch *ds, int port)
                hdr_ctl |= GC_FRM_MGMT_PORT_M;
        b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, hdr_ctl);

+       /* B53_BRCM_HDR not present on BCM5325 */
+       if (is5325(dev))
I think this can/should be replaced with a check for dev->tag_protocol
being DSA_TAG_PROTO_BRCM_LEGACY, as there is AFAICT a strong
correlation between the legacy header being used and the B53_BRCM_HDR
register not existing.

Regards,
Jonas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help