]> git.baikalelectronics.ru Git - kernel.git/commit
net: lan966x: Fix usage of lan966x->mac_lock inside lan966x_mac_irq_handler
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Thu, 14 Jul 2022 19:40:39 +0000 (21:40 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Jul 2022 03:00:00 +0000 (20:00 -0700)
commitd4d9d397f9d2c146f7474ac3de63dcc3ed8a6829
tree7d6085da4ee3561a4b28b9721cef6fdcdda6d13f
parent76eccc7ed1fc43f68eb36236b575ab71dc3edd8a
net: lan966x: Fix usage of lan966x->mac_lock inside lan966x_mac_irq_handler

The problem with this spin lock is that it was just protecting the list
of the MAC entries in SW and not also the access to the MAC entries in HW.
Because the access to HW is indirect, then it could happen to have race
conditions.
For example when SW introduced an entry in MAC table and the irq mac is
trying to read something from the MAC.
Update such that also the access to MAC entries in HW is protected by
this lock.

Fixes: ab3e5f5e79c69 ("net: lan966x: add support for interrupts from analyzer")
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