WSL2-Linux-Kernel/drivers/net/dsa/xrs700x
Sebastian Andrzej Siewior d6ec2f711c net: dsa: xrs700x: Use irqsave variant for u64 stats update
[ Upstream commit 3f8ae9fe04 ]

xrs700x_read_port_counters() updates the stats from a worker using the
u64_stats_update_begin() version. This is okay on 32-UP since on the
reader side preemption is disabled.
On 32bit-SMP the writer can be preempted by the reader at which point
the reader will spin on the seqcount until writer continues and
completes the update.

Assigning the mib_mutex mutex to the underlying seqcount would ensure
proper synchronisation. The API for that on the u64_stats_init() side
isn't available. Since it is the only user, just use disable interrupts
during the update.

Use u64_stats_update_begin_irqsave() on the writer side to ensure an
uninterrupted update.

Fixes: ee00b24f32 ("net: dsa: add Arrow SpeedChips XRS700x driver")
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-09-08 12:28:02 +02:00
..
Kconfig
Makefile
xrs700x.c net: dsa: xrs700x: Use irqsave variant for u64 stats update 2022-09-08 12:28:02 +02:00
xrs700x.h net: dsa: xrs700x: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
xrs700x_i2c.c net: dsa: xrs700x: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
xrs700x_mdio.c net: dsa: xrs700x: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
xrs700x_reg.h net: dsa: xrs700x: add HSR offloading support 2021-02-11 13:24:45 -08:00