Skip to content

Commit e785904

Browse files
ffainelligregkh
authored andcommitted
net: phy: Do not warn in phy_stop() on PHY_DOWN
[ Upstream commit 5116a8a ] When phy_is_started() was added to catch incorrect PHY states, phy_stop() would not be qualified against PHY_DOWN. It is possible to reach that state when the PHY driver has been unbound and the network device is then brought down. Fixes: 2b3e88e ("net: phy: improve phy state checking") Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 94f2dc7 commit e785904

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/phy/phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ EXPORT_SYMBOL(phy_free_interrupt);
834834
*/
835835
void phy_stop(struct phy_device *phydev)
836836
{
837-
if (!phy_is_started(phydev)) {
837+
if (!phy_is_started(phydev) && phydev->state != PHY_DOWN) {
838838
WARN(1, "called from state %s\n",
839839
phy_state_to_str(phydev->state));
840840
return;

0 commit comments

Comments
 (0)