diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-08-16 16:53:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-25 12:45:38 +0300 |
commit | 0d05a558033e18e2b92f1b086bd405a5fd4494ff (patch) | |
tree | 88e8d45a62f426e0aef326f13e257cc90524b12d /include | |
parent | 62ef55aa4381c8adbd2b8364bfd1f76e02dfa4d0 (diff) | |
download | linux-0d05a558033e18e2b92f1b086bd405a5fd4494ff.tar.xz |
net: mscc: ocelot: turn stats_lock into a spinlock
[ Upstream commit 22d842e3efe56402c33b5e6e303bb71ce9bf9334 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/soc/mscc/ocelot.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index e7e5b06deb2d..72b9474391da 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -752,7 +752,7 @@ struct ocelot { struct ocelot_psfp_list psfp; /* Workqueue to check statistics for overflow with its lock */ - struct mutex stats_lock; + spinlock_t stats_lock; u64 *stats; struct delayed_work stats_work; struct workqueue_struct *stats_queue; |