]> git.baikalelectronics.ru Git - kernel.git/commit
net: sfp: add mutex to prevent concurrent state checks
authorRobert Hancock <hancock@sedsystems.ca>
Fri, 7 Jun 2019 16:42:36 +0000 (10:42 -0600)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Jun 2019 02:25:59 +0000 (19:25 -0700)
commited178031b4a4071ff2a0a96935c9fb1ad231be8d
tree50eb78dea2a7df27e52f863b4c2a288ac4e54e9f
parent9e958df20dc94ba1726ed4b4db8631fe1fb064dc
net: sfp: add mutex to prevent concurrent state checks

sfp_check_state can potentially be called by both a threaded IRQ handler
and delayed work. If it is concurrently called, it could result in
incorrect state management. Add a st_mutex to protect the state - this
lock gets taken outside of code that checks and handle state changes, and
the existing sm_mutex nests inside of it.

Suggested-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp.c