]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: Avoid deadlock during phy_error()
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 20 Jan 2017 23:31:52 +0000 (15:31 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Jan 2017 20:37:10 +0000 (15:37 -0500)
commit770584df5aa3b52d0d358e91a17b537317c883f2
tree844269bbc845f289d134965033ff37e0243c0811
parent577ae8da53c077ea6d0e67bde538e851bac4eda3
net: phy: Avoid deadlock during phy_error()

phy_error() is called in the PHY state machine workqueue context, and
calls phy_trigger_machine() which does a cancel_delayed_work_sync() of
the workqueue we execute from, causing a deadlock situation.

Augment phy_trigger_machine() machine with a sync boolean indicating
whether we should use cancel_*_sync() or just cancel_*_work().

Fixes: 5ccb5a777d9c ("net: phy: Trigger state machine on state change and not polling.")
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c