summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/ocelot
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2022-09-08 19:48:04 +0300
committerDavid S. Miller <davem@davemloft.net>2022-09-09 10:59:12 +0100
commit96980ff7c2caa5baef0c684e719547a53762e82c (patch)
treee5f702255b90a8d9d33d45de3cc4bf7543b1977a /drivers/net/dsa/ocelot
parent0a2360c59687e4caec363565c166e8a2b3e30677 (diff)
net: mscc: ocelot: make access to STAT_VIEW sleepable again
To support SPI-controlled switches in the future, access to SYS_STAT_CFG_STAT_VIEW needs to be done outside of any spinlock protected region, but it still needs to be serialized (by a mutex). Split the ocelot->stats_lock spinlock into a mutex that serializes indirect access to hardware registers (ocelot->stat_view_lock) and a spinlock that serializes access to the u64 ocelot->stats array. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/ocelot')
-rw-r--r--drivers/net/dsa/ocelot/felix_vsc9959.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 3c80df4253b2..858ccf1e67f0 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -2574,7 +2574,7 @@ static void vsc9959_psfp_sgi_table_del(struct ocelot *ocelot,
static void vsc9959_psfp_counters_get(struct ocelot *ocelot, u32 index,
struct felix_stream_filter_counters *counters)
{
- spin_lock(&ocelot->stats_lock);
+ mutex_lock(&ocelot->stat_view_lock);
ocelot_rmw(ocelot, SYS_STAT_CFG_STAT_VIEW(index),
SYS_STAT_CFG_STAT_VIEW_M,
@@ -2593,7 +2593,7 @@ static void vsc9959_psfp_counters_get(struct ocelot *ocelot, u32 index,
SYS_STAT_CFG_STAT_CLEAR_SHOT(0x10),
SYS_STAT_CFG);
- spin_unlock(&ocelot->stats_lock);
+ mutex_unlock(&ocelot->stat_view_lock);
}
static int vsc9959_psfp_filter_add(struct ocelot *ocelot, int port,