From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com ([209.85.128.196]:41511 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751454AbeCPVZv (ORCPT ); Fri, 16 Mar 2018 17:25:51 -0400 Received: by mail-wr0-f196.google.com with SMTP id f14so12895393wre.8 for ; Fri, 16 Mar 2018 14:25:50 -0700 (PDT) Subject: [PATCH RFC v2 6/7] net: phy: use new function phy_stop_suspending in mdio_bus_phy_suspend From: Heiner Kallweit To: Florian Fainelli , Andrew Lunn , Geert Uytterhoeven Cc: "netdev@vger.kernel.org" References: <6618f53c-778a-cb12-deb4-c618a728b43e@gmail.com> Message-ID: Date: Fri, 16 Mar 2018 22:24:50 +0100 MIME-Version: 1.0 In-Reply-To: <6618f53c-778a-cb12-deb4-c618a728b43e@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: Use new function phy_stop_suspending() in mdio_bus_phy_suspend() to also disable interrupts and set link state to down. Signed-off-by: Heiner Kallweit --- v2: - no changes --- drivers/net/phy/phy_device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ed97f152..a33dec37 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -139,6 +139,7 @@ static bool mdio_bus_phy_needs_start(struct phy_device *phydev) static int mdio_bus_phy_suspend(struct device *dev) { struct phy_device *phydev = to_phy_device(dev); + int ret = 0; /* We must stop the state machine manually, otherwise it stops out of * control, possibly with the phydev->lock held. Upon resume, netdev @@ -146,9 +147,11 @@ static int mdio_bus_phy_suspend(struct device *dev) * lead to a deadlock. */ if (phydev->attached_dev && phydev->adjust_link) - phy_stop_machine(phydev); + phy_stop_suspending(phydev); + else + ret = phy_suspend(phydev); - return phy_suspend(phydev); + return ret; } static int mdio_bus_phy_resume(struct device *dev) -- 2.16.2