]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: lantiq_gswip: serialize access to the PCE table
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 22 Oct 2021 18:43:08 +0000 (21:43 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Oct 2021 12:47:44 +0000 (13:47 +0100)
commit3811a19a39670626fcc9b2dc835d4ef9dffef3af
treebe8a8628faea239788f25e13da18bba606187319
parent276ee1da840e2f0da8cb4aa6d64883628450259b
net: dsa: lantiq_gswip: serialize access to the PCE table

Looking at the code, the GSWIP switch appears to hold bridging service
structures (VLANs, FDBs, forwarding rules) in PCE table entries.
Hardware access to the PCE table is non-atomic, and is comprised of
several register reads and writes.

These accesses are currently serialized by the rtnl_lock, but DSA is
changing its driver API and that lock will no longer be held when
calling ->port_fdb_add() and ->port_fdb_del().

So this driver needs to serialize the access to the PCE table using its
own locking scheme. This patch adds that.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/lantiq_gswip.c