From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH net-next 02/10] r8169: use phy_resume/phy_suspend Date: Tue, 3 Jul 2018 09:44:51 -0700 Message-ID: References: <096a5326-963c-9bef-6218-29fcde004111@gmail.com> <318ae669-d89c-636d-94ac-d4c9f662400e@gmail.com> <20180702210646.GB12564@lunn.ch> <8ef120d3-ac4a-7ffd-2104-76d6f1268105@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: David Miller , Realtek linux nic maintainers , "netdev@vger.kernel.org" To: Heiner Kallweit , Andrew Lunn Return-path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:36050 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932520AbeGCQoy (ORCPT ); Tue, 3 Jul 2018 12:44:54 -0400 Received: by mail-wm0-f67.google.com with SMTP id s14-v6so3015593wmc.1 for ; Tue, 03 Jul 2018 09:44:54 -0700 (PDT) In-Reply-To: <8ef120d3-ac4a-7ffd-2104-76d6f1268105@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 07/02/2018 02:24 PM, Heiner Kallweit wrote: > On 02.07.2018 23:06, Andrew Lunn wrote: >>> static void r8168_pll_power_down(struct rtl8169_private *tp) >>> { >>> if (r8168_check_dash(tp)) >>> @@ -4510,7 +4469,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp) >>> if (rtl_wol_pll_power_down(tp)) >>> return; >>> >>> - r8168_phy_power_down(tp); >>> + /* cover the case that PHY isn't connected */ >>> + phy_suspend(mdiobus_get_phy(tp->mii_bus, 0)); >> >> This could do some more explanation. Why would it not be connected? >> > The PHY gets connected when the net_device is opened. If a network > port isn't used then it will be runtime-suspended a few seconds after > boot. In this case we call r8168_pll_power_down() with the PHY not > being connected. Would not the !netif_running() check in rtl8169_net_suspend() take care of that though? -- Florian