From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH net-next v2 0/2] net: phy: improve PHY suspend/resume Date: Fri, 1 Jun 2018 02:10:43 +0200 Message-ID: <20180601001043.GA2303@lunn.ch> References: <8fe93623-9d05-6182-fe5f-da0bd32bae0b@gmail.com> <20180523220418.GB5128@lunn.ch> <5b9eceab-35b4-922c-7410-d8968d8364c7@gmail.com> <20180530203512.GA16286@lunn.ch> <1d79c2ae-6f63-694f-6c63-6369c854de69@gmail.com> <20180531183040.GA7378@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Florian Fainelli , David Miller , "netdev@vger.kernel.org" To: Heiner Kallweit Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:51224 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbeFAAKr (ORCPT ); Thu, 31 May 2018 20:10:47 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: > Configuring the different WoL options isn't handled by writing to > the PHY registers but by writing to chip / MAC registers. > Therefore phy_suspend() isn't able to figure out whether WoL is > enabled or not. Only the parent has the full picture. Hi Heiner I think you need to look at your different runtime PM domains. If i understand the code right, you runtime suspend if there is no link. But for this to work correctly, your PHY needs to keep working. You also cannot assume all accesses to the PHY go via the MAC. Some calls will go direct to the PHY, and they can trigger MDIO bus accesses. So i think you need two runtime PM domains. MAC and MDIO bus. Maybe just the pll? An MDIO bus is a device, so it can have its on PM callbacks. It is not clear what you need to resume in order to make MDIO work. It might also help if you do the phy_connect in .ndo_open and disconnect in .ndo_stop. This is a common pattern in drivers. But some also do it is probe and remove. Andrew