From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiner Kallweit Subject: [PATCH net-next v2 0/2] net: phy: improve PHY suspend/resume Date: Wed, 23 May 2018 22:15:29 +0200 Message-ID: <8fe93623-9d05-6182-fe5f-da0bd32bae0b@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" To: Andrew Lunn , Florian Fainelli , David Miller Return-path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:42323 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934181AbeEWUPk (ORCPT ); Wed, 23 May 2018 16:15:40 -0400 Received: by mail-wr0-f194.google.com with SMTP id w10-v6so5914127wrk.9 for ; Wed, 23 May 2018 13:15:39 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: I have the issue that suspending the MAC-integrated PHY gives an error during system suspend. The sequence is: 1. unconnected PHY/MAC are runtime-suspended already 2. system suspend commences 3. mdio_bus_phy_suspend is called 4. suspend callback of the network driver is called (implicitly MAC/PHY are runtime-resumed before) 5. suspend callback suspends MAC/PHY The problem occurs in step 3. phy_suspend() fails because the MDIO bus isn't accessible due to the chip being runtime-suspended. This series mainly adds a check to not suspend the PHY if the MDIO bus parent is runtime-suspended. Changes in v2: - Check for MDIO bus parent being runtime-suspended before calling phy_ethtool_get_wol() which could access the MDIO bus. Heiner Kallweit (2): net: phy: improve check for when to call phy_resume in mdio_bus_phy_resume net: phy: improve checks when to suspend the PHY drivers/net/phy/phy_device.c | 45 +++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 19 deletions(-) -- 2.17.0