public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] net: mscc: ocelot: fix missing lock in ocelot_port_xmit()
@ 2026-02-08 22:55 Ziyi Guo
  2026-02-08 22:56 ` [PATCH v3 1/3] net: mscc: ocelot: extract ocelot_xmit_timestamp() helper Ziyi Guo
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ziyi Guo @ 2026-02-08 22:55 UTC (permalink / raw)
  To: Vladimir Oltean, Claudiu Manoil, Alexandre Belloni
  Cc: UNGLinuxDriver, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel, Ziyi Guo

ocelot_port_xmit() calls ocelot_can_inject() and
ocelot_port_inject_frame() without holding the injection group lock.
Both functions contain lockdep_assert_held() for the injection lock,
and the correct caller felix_port_deferred_xmit() properly acquires
the lock using ocelot_lock_inj_grp() before calling these functions.

this v3 splits the fix into a 3-patch series to separate 
refactoring from the behavioral change:

  1/3: Extract the PTP timestamp handling into an ocelot_xmit_timestamp()
       helper so the logic isn't duplicated when the function is split.

  2/3: Split ocelot_port_xmit() into ocelot_port_xmit_fdma() and
       ocelot_port_xmit_inj(), keeping the FDMA and register injection
       code paths fully separate.

  3/3: Add ocelot_lock_inj_grp()/ocelot_unlock_inj_grp() in
       ocelot_port_xmit_inj() to fix the missing lock protection.

Patches 1-2 are pure refactors with no behavioral change.
Patch 3 is the actual bug fix.

v3:
 - Split into 3-patch series per Vladimir's review
 - Separate FDMA and register injection paths into distinct functions
v2:
 - Added Fixes tag
v1:
 - Initial submission

Ziyi Guo (3):
  net: mscc: ocelot: extract ocelot_xmit_timestamp() helper
  net: mscc: ocelot: split xmit into FDMA and register injection paths
  net: mscc: ocelot: add missing lock protection in
    ocelot_port_xmit_inj()

 drivers/net/ethernet/mscc/ocelot_net.c | 75 +++++++++++++++++++-------
 1 file changed, 56 insertions(+), 19 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-13  3:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-08 22:55 [PATCH v3 0/3] net: mscc: ocelot: fix missing lock in ocelot_port_xmit() Ziyi Guo
2026-02-08 22:56 ` [PATCH v3 1/3] net: mscc: ocelot: extract ocelot_xmit_timestamp() helper Ziyi Guo
2026-02-08 22:56 ` [PATCH v3 2/3] net: mscc: ocelot: split xmit into FDMA and register injection paths Ziyi Guo
2026-02-08 22:56 ` [PATCH v3 3/3] net: mscc: ocelot: add missing lock protection in ocelot_port_xmit_inj() Ziyi Guo
2026-02-09  8:56 ` [PATCH v3 0/3] net: mscc: ocelot: fix missing lock in ocelot_port_xmit() Vladimir Oltean
2026-02-13  3:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox