net: mscc: ocelot: turn stats_lock into a spinlock
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 16 Aug 2022 13:53:48 +0000 (16:53 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Aug 2022 04:58:31 +0000 (21:58 -0700)
commit22d842e3efe56402c33b5e6e303bb71ce9bf9334
tree995119d278a788424f32aee0c854562f70f221b4
parent173ca86618d751bd183456c9cdbb69952ba283c8
net: mscc: ocelot: turn stats_lock into a spinlock

ocelot_get_stats64() currently runs unlocked and therefore may collide
with ocelot_port_update_stats() which indirectly accesses the same
counters. However, ocelot_get_stats64() runs in atomic context, and we
cannot simply take the sleepable ocelot->stats_lock mutex. We need to
convert it to an atomic spinlock first. Do that as a preparatory change.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/ocelot/felix_vsc9959.c
drivers/net/ethernet/mscc/ocelot.c
include/soc/mscc/ocelot.h