Netdev List
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <florian.fainelli@broadcom.com>,
	Jonas Gorski <jonas.gorski@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net v7 0/6] net: dsa: b53: Preliminary fixes
Date: Thu, 19 Nov 2026 11:03:42 -0800	[thread overview]
Message-ID: <20261119190348.2317702-1-florian.fainelli@broadcom.com> (raw)

This patch series contains fixes to issues reported by Sashiko on the
b53 PCS bug fixes being submitted, and then some more that came from
code review and testing.

Except for issue #2, all of the other issues did trigger in testing and
needed to be corrected.

Changes in v7:

- reduce the series from eight patches to six, following Sashiko's review
- move the BCM5325/BCM5365 mirror encoding fix ahead of the other mirror
  changes, adapting it to the original add/delete paths (now patch 5)
- combine v6 patches 4, 6 and 7 into patch 6 so destination ownership,
  source reference counting, register error handling and initialization
  are introduced together, without intermediate regressions
- introduce b53_mirror_init(), its declaration and both setup callers in
  the same patch; explicitly document the dependency on the encoding fix
- drop Jonas' Reviewed-by from the combined mirror patch because its
  scope has changed substantially
- keep the other four fixes unchanged; the override-register fix is now
  patch 4, and the final tree is identical to v6
- validate both mirror patches with ARM built-in and module builds,
  strict B53/SF2 driver compilation and mocked register regression tests;
  no switch hardware or suspend/resume hardware testing was performed

Changes in v6:

- patch 3: drop the commit message paragraph claiming that deleting an
  absent entry now returns -ENOENT, the return value is unchanged (0)
- patch 4: describe the b53_mirror_del() capture port clear as a
  cleanup rather than a separate fix
- patch 5: add a Fixes: tag for 41af38324341, which covers the 2 Gbps
  set path on GMII override registers
- patch 6: do not propagate the ds->ops->setup() error from
  bcm_sf2_sw_resume(), setup re-registers the devlink VLAN resource on
  resume and would return -EEXIST, leaving the user ports down
- patch 7: document that active mirror rules are restored on resume and
  that the patch depends on patches 4 and 6; verified the mirror
  register offsets against the BCM6368, BCM6362 and BCM63268 datasheets

Changes in v5:

- resolved build warning in patch #7 by moving b53_mirror_init()'s
  declaration into patch #6

Changes in v4:

- Return success when deleting an ARL entry that does not exist per
  Sashiko's review
- Restrict the 2 Gbps override bit to BCM5301x and BCM58xx
- Restore mirror configuration on resume, moving mirror initialization into the reference-counting patch
- Propagate SF2 setup errors on resume and disable the clock on failure when WoL is inactive
- Add a patch fixing BCM5325/BCM5365 mirror port encoding, including CPU port bitmap translation

Changes in v3:

- patch 2: added Daniel's R-b tag
- patch 3: mention in the commit message that deleting an absent entry
  now returns -ENOENT, including when the lookup runs out of space
- patch 4: document that the patch also fixes the clear of the capture
  port field in b53_mirror_del()
- patch 6: reference count the mirror source bits per port and
  direction, ignoring deletions without a matching reference
- patch 7: new, harden mirror register programming:
  - reset the mirror capture and source control registers at setup for
    b53 and bcm_sf2, since not all switches are reset
  - check and propagate all mirror register read/write errors, only
    taking a source reference once hardware programming succeeded
  - use the source masks rather than MIRROR_EN to decide whether the
    destination is occupied, and write the destination before the source
- log failures in b53_mirror_del() since it cannot return an error
- patch 8: new, fix the mirror capture port encoding on BCM5325 and
  BCM5365, which use an 11-bit bitmap (CPU port at bit 8) instead of a
  port ID, and translate the CPU port in the ingress/egress source
  masks as well (verified against the BCM5325E, BCM5325M and BCM5365P
  datasheets)

Changes in v2:

- collected Jonas' R-b tags
- corrected logic in patch #3 to propagate -ENOENT, memset after the
  debug print, translate -ENOSPC to -ENOENT when deleting


Florian Fainelli (6):
  net: dsa: b53: initialize the jumbo frame size register offset
  net: dsa: b53: fix the SRAB grant timeout check
  net: dsa: b53: clear stale state when creating an ARL entry
  net: dsa: b53: use the correct override register 2 Gbps bit
  net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365
  net: dsa: b53: fix mirror destination and source state tracking

 drivers/net/dsa/b53/b53_common.c | 209 +++++++++++++++++++++++++------
 drivers/net/dsa/b53/b53_priv.h   |   4 +
 drivers/net/dsa/b53/b53_regs.h   |   1 +
 drivers/net/dsa/b53/b53_srab.c   |   2 +-
 drivers/net/dsa/bcm_sf2.c        |   4 +
 5 files changed, 179 insertions(+), 41 deletions(-)


base-commit: 7e1392a42ea288d70a266f6553fe06f57f8647ea
-- 
2.53.0


             reply	other threads:[~2026-11-19 19:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 19:03 Florian Fainelli [this message]
2026-11-19 19:03 ` [PATCH net v7 1/6] net: dsa: b53: initialize the jumbo frame size register offset Florian Fainelli
2026-11-19 19:03 ` [PATCH net v7 2/6] net: dsa: b53: fix the SRAB grant timeout check Florian Fainelli
2026-11-19 19:03 ` [PATCH net v7 3/6] net: dsa: b53: clear stale state when creating an ARL entry Florian Fainelli
2026-11-19 19:03 ` [PATCH net v7 4/6] net: dsa: b53: use the correct override register 2 Gbps bit Florian Fainelli
2026-11-19 19:03 ` [PATCH net v7 5/6] net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365 Florian Fainelli
2026-11-19 19:03 ` [PATCH net v7 6/6] net: dsa: b53: fix mirror destination and source state tracking Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261119190348.2317702-1-florian.fainelli@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jonas.gorski@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox