From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933002AbcFJM3y (ORCPT ); Fri, 10 Jun 2016 08:29:54 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:21885 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932173AbcFJM3v (ORCPT ); Fri, 10 Jun 2016 08:29:51 -0400 Subject: Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL To: Vincent Palatin , Andrew Lunn References: <1464974960-26672-1-git-send-email-vpalatin@chromium.org> <20160609001739.GA2227@lunn.ch> CC: , LKML , Alexandre Torgue , =?UTF-8?Q?Heiko_St=c3=bcbner?= , Douglas Anderson From: Giuseppe CAVALLARO Message-ID: Date: Fri, 10 Jun 2016 14:29:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.139.54] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-10_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Vincent On 6/10/2016 1:00 AM, Vincent Palatin wrote: > On Wed, Jun 8, 2016 at 5:17 PM, Andrew Lunn wrote: >> On Wed, Jun 08, 2016 at 03:25:38PM -0700, Vincent Palatin wrote: >>> On Tue, Jun 7, 2016 at 12:23 AM, Giuseppe CAVALLARO >>> wrote: >>>> Hello >>>> >>>> On 6/3/2016 7:29 PM, Vincent Palatin wrote: >>>>> >>>>> Do not shutdown the PHY if Wake-on-Lan is enabled, else it cannot wake >>>>> us up. >>>>> >>>> >>>> I do not understand why you need that. >>>> This is done inside the PHY layer and it is tested on our platforms >>>> he idea is: If the parent wants to Wake the system then the PHY should >>>> not power-down. >>> >>> I'm not sure I understand : >>> you mean that this path is not called if WoL is enabled ? >>> [ currently stmmac_pltfr_suspend() is calling priv->plat->exit() which >>> is the rk_gmac_exit() code I'm modifying ] >>> or the RK driver code should not power down the phy in its exit() callback ? >> >> Take a look at phy_suspend(). > > phy_suspend() sends (or not) the PowerDown command to the PHY through > the MDIO bus, depending if WoL is disabled, > but most of my question still stands as far as I can tell : > I was trying to get a proper WoL support on the following setup : > dwmac (inside a RK3288 SoC) connected to RTL8211 PHY > The current upstream code for this case will call rk_gmac_exit() when > the MAC suspends (after the PHY has already suspended). Effectively > doing a phy_power_on(, false) which is calling regulator_disable() on > the LDO defined by the 'phy-supply' attribute. > So my reading is that the RK specific MAC code is turning off > unconditionally the PHY power regulator. Unless I'm mistaken, either > this code is incorrect for the WoL case or the naming 'phy-supply' is > misleading and should be the MAC supply. ok now clear. And you are right. I can conclude that the patch is ok for me. I just ask you to resend it elaborating a bit the subject and surrounding the code with a comment. I do not know your SoC but indeed, when doing WoL, some parts of the MAC + PHY must be powered so IMO it is legal that you do not cut the power by invoking regulator. Peppe