]> git.proxmox.com Git - mirror_ubuntu-zesty-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)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 22 Aug 2017 09:58:15 +0000 (06:58 -0300)
commit010c2730cdc85a759e6b992d4917ba880396ecde
tree4685cb4465963962e084aa5297c6e969e59c8701
parent889a28c8db0a7e250d93bed7cd698a422fb88060
net: phy: Correctly process PHY_HALTED in phy_stop_machine()

BugLink: http://bugs.launchpad.net/bugs/1711526
[ Upstream commit 7ad813f208533cebfcc32d3d7474dc1677d1b09a ]

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: a390d1f379cf ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/net/phy/phy.c