Skip to contentSkip to conversation

Patch "net: phy: Correctly process PHY_HALTED in phy_stop_machine()" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Aug 9, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net: phy: Correctly process PHY_HALTED in phy_stop_machine()

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-phy-correctly-process-phy_halted-in-phy_stop_machine.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Tue Aug 8 16:54:20 PDT 2017

From: Florian Fainelli <[email protected]>
Date: Fri, 28 Jul 2017 11:58:36 -0700
Subject: net: phy: Correctly process PHY_HALTED in phy_stop_machine()

From: Florian Fainelli <[email protected]>

[ 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.

Fixes a390d1f379cf ("phylib: convert state_queue work to delayed_work")
---
 drivers/net/phy/phy.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/phy.c +3 -0
@@ -509,6 +509,9 @@ void phy_stop_machine(struct phy_device
 	if (phydev->state > PHY_UP && phydev->state != PHY_HALTED)
 		phydev->state = PHY_UP;
 	mutex_unlock(&phydev->lock);
+
+	/* Now we can run the state machine synchronously */
+	phy_state_machine(&phydev->state_queue.work);
 }
 
 /**

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/net-phy-do-not-perform-software-reset-for-generic-phy.patch queue-3.18/net-phy-correctly-process-phy_halted-in-phy_stop_machine.patch