net: lan966x: Fix usage of lan966x->mac_lock when used by FDB
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Thu, 14 Jul 2022 19:40:40 +0000 (21:40 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Jul 2022 03:00:00 +0000 (20:00 -0700)
commit675c807ae26b267233b97cd5006979a6bb8d54d4
tree953f205f20f82e79d5501db326d72d40b787fa71
parentc1924684369762b112428a333ad00eac6ca89d96
net: lan966x: Fix usage of lan966x->mac_lock when used by FDB

When the SW bridge was trying to add/remove entries to/from HW, the
access to HW was not protected by any lock. In this way, it was
possible to have race conditions.
Fix this by using the lan966x->mac_lock to protect parallel access to HW
for this cases.

Fixes: 25ee9561ec622 ("net: lan966x: More MAC table functionality")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan966x/lan966x_mac.c