diff options
| author | Sebastian Andrzej Siewior <[email protected]> | 2022-08-25 11:36:44 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-08-29 12:02:26 +0000 |
| commit | 3f8ae9fe0409698799e173f698b714f34570b64b (patch) | |
| tree | bf7550925227acac89bd5810c751976bfcd9fe3d /drivers/net/netdevsim/netdev.c | |
| parent | r8152: add PID for the Lenovo OneLink+ Dock (diff) | |
| download | kernel-3f8ae9fe0409698799e173f698b714f34570b64b.tar.gz kernel-3f8ae9fe0409698799e173f698b714f34570b64b.zip | |
net: dsa: xrs700x: Use irqsave variant for u64 stats update
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: ee00b24f32eb8 ("net: dsa: add Arrow SpeedChips XRS700x driver")
Cc: Andrew Lunn <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: George McCollister <[email protected]>
Cc: Vivien Didelot <[email protected]>
Cc: Vladimir Oltean <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Acked-by: George McCollister <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/netdevsim/netdev.c')
0 files changed, 0 insertions, 0 deletions
