From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiner Kallweit Subject: Re: [PATCH net-next v2 02/10] r8169: use phy_resume/phy_suspend Date: Tue, 10 Jul 2018 23:56:00 +0200 Message-ID: <8fe5cd19-eeb6-1c51-4c4e-3d37f78ed16c@gmail.com> References: <84ac1cb7-bafd-5f15-8cda-e8dfd7d0deb3@gmail.com> <20180710191509.GC11754@lunn.ch> <20180710205247.GI892@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: David Miller , Florian Fainelli , Realtek linux nic maintainers , "netdev@vger.kernel.org" To: Andrew Lunn Return-path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:53523 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732259AbeGJV5M (ORCPT ); Tue, 10 Jul 2018 17:57:12 -0400 Received: by mail-wm0-f65.google.com with SMTP id b188-v6so469129wme.3 for ; Tue, 10 Jul 2018 14:56:07 -0700 (PDT) In-Reply-To: <20180710205247.GI892@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10.07.2018 22:52, Andrew Lunn wrote: >>> Why is it powered up, but not connected? Is it powered down before it >>> is disconnected? Is it the bootloader which is powering it up? >>> >> Exactly, if the device is active when driver is loaded and the >> interface isn't used and therefore not brought up, then, when runtime- >> suspending, we face this situation. > > Well, it is more complex than that. If the interface is not used, why > bother even loading the MAC driver? > > If you are trying to make a really low power system, the bootloader > also needs to be involved. It needs to shut down anything it starts > before handing over control the linux. > > Another approach is to handle this in phylib. When the mdio bus is > suspended, look for any PHYs which are not connected and power them > down. The assumption being, any MAC driver using WoL via a PHY does > not disconnect the PHY before suspending. > Tricky part may be the differentiation between system- and runtime- suspend. IIRC the MDIO bus doesn't have runtime pm ops (yet) and most likely we would have to add them. > Andrew >