diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-10-24 19:17:51 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-25 13:59:41 +0200 |
commit | 2468346c5677919de288bee85a0fefbef70c1e4e (patch) | |
tree | 16bb4823f558fb446ebf61ce0ea2e5643460115b /include/soc | |
parent | net: dsa: sja1105: serialize access to the dynamic config interface (diff) | |
download | linux-2468346c5677919de288bee85a0fefbef70c1e4e.tar.xz linux-2468346c5677919de288bee85a0fefbef70c1e4e.zip |
net: mscc: ocelot: serialize access to the MAC table
DSA would like to remove the rtnl_lock from its
SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE handlers, and the felix driver uses
the same MAC table functions as ocelot.
This means that the MAC table functions will no longer be implicitly
serialized with respect to each other by the rtnl_mutex, we need to add
a dedicated lock in ocelot for the non-atomic operations of selecting a
MAC table row, reading/writing what we want and polling for completion.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/soc')
-rw-r--r-- | include/soc/mscc/ocelot.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 9b872da0c246..fef3a36b0210 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -675,6 +675,9 @@ struct ocelot { struct delayed_work stats_work; struct workqueue_struct *stats_queue; + /* Lock for serializing access to the MAC table */ + struct mutex mact_lock; + struct workqueue_struct *owq; u8 ptp:1; |