]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: Correctly process PHY_HALTED in phy_stop_machine()
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 28 Jul 2017 18:58:36 +0000 (11:58 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Aug 2017 00:27:10 +0000 (17:27 -0700)
commit36f5fceb13f226cbb16871a4eafcda0957e10390
tree6f5ac7c52ed7b4e8f7870b5141946d51a90708db
parent3d954b749f6e998af88fd1bbada06a90cb55ad1b
net: phy: Correctly process PHY_HALTED in phy_stop_machine()

Marc reported that he was not getting the PHY library adjust_link()
callback function to run when calling phy_stop() + phy_disconnect()
which does not indeed happen because we set the state machine to
PHY_HALTED but we don't get to run it to process this state past that
point.

Fix this with a synchronous call to phy_state_machine() in order to have
the state machine actually act on PHY_HALTED, set the PHY device's link
down, turn the network device's carrier off and finally call the
adjust_link() function.

Reported-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Fixes: c1d754fe8aef ("phylib: convert state_queue work to delayed_work")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c