mirror-linux/drivers/net/ethernet/cadence
Sean Anderson fa52f15c74 net: cadence: macb: Synchronize stats calculations
Stats calculations involve a RMW to add the stat update to the existing
value. This is currently not protected by any synchronization mechanism,
so data races are possible. Add a spinlock to protect the update. The
reader side could be protected using u64_stats, but we would still need
a spinlock for the update side anyway. And we always do an update
immediately before reading the stats anyway.

Fixes: 89e5785fc8 ("[PATCH] Atmel MACB ethernet driver")
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Link: https://patch.msgid.link/20250220162950.95941-1-sean.anderson@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-02-21 16:31:35 -08:00
..
Kconfig
Makefile
macb.h net: cadence: macb: Synchronize stats calculations 2025-02-21 16:31:35 -08:00
macb_main.c net: cadence: macb: Synchronize stats calculations 2025-02-21 16:31:35 -08:00
macb_pci.c net: macb: Use predefined PCI vendor ID constant 2024-09-13 20:08:53 -07:00
macb_ptp.c net: macb: Convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() 2023-11-18 14:52:57 +00:00