From: Anssi Hannula Subject: [PATCH 1/2] net: phy: suspend phydev on PHY_HALTED even if there is no link Date: Fri, 30 Nov 2018 20:45:45 +0200 Message-ID: <20181130184546.28384-2-anssi.hannula@bitwise.fi> References: <20181130184546.28384-1-anssi.hannula@bitwise.fi> Cc: "David S. Miller" , netdev@vger.kernel.org, Sebastian Hesselbarth To: Andrew Lunn , Florian Fainelli , Heiner Kallweit Return-path: Received: from mail.bitwise.fi ([109.204.228.163]:54432 "EHLO mail.bitwise.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbeLAF5O (ORCPT ); Sat, 1 Dec 2018 00:57:14 -0500 In-Reply-To: <20181130184546.28384-1-anssi.hannula@bitwise.fi> Sender: netdev-owner@vger.kernel.org List-ID: When the phydev is put to PHY_HALTED (by e.g. phy_stop()) the state machine suspends the phydev to save power. However, this is wrongly inside a phydev->link check, causing the phydev not to be suspended if there was no link at the time of stopping it. Fix that by setting do_suspend regardless of whether there was a link or not. Signed-off-by: Anssi Hannula Fixes: be9dad1f9f26 ("net: phy: suspend phydev when going to HALTED") Cc: Sebastian Hesselbarth --- drivers/net/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 376a0d8a2b61..d46858694db9 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -956,8 +956,8 @@ void phy_state_machine(struct work_struct *work) if (phydev->link) { phydev->link = 0; phy_link_down(phydev, true); - do_suspend = true; } + do_suspend = true; break; } -- 2.17.2