[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c7e546d5-328d-3192-73f2-98ada00779f7@gmail.com>
Date: Fri, 16 Mar 2018 22:24:50 +0100
From: Heiner Kallweit <hkallweit1@...il.com>
To: Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Geert Uytterhoeven <geert+renesas@...der.be>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH RFC v2 6/7] net: phy: use new function phy_stop_suspending in
mdio_bus_phy_suspend
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 <hkallweit1@...il.com>
---
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
Powered by blists - more mailing lists