From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753727AbcFGHXR (ORCPT ); Tue, 7 Jun 2016 03:23:17 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:47584 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932253AbcFGHXO (ORCPT ); Tue, 7 Jun 2016 03:23:14 -0400 Subject: Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL To: Vincent Palatin , References: <1464974960-26672-1-git-send-email-vpalatin@chromium.org> CC: , Alexandre Torgue , =?UTF-8?Q?Heiko_St=c3=bcbner?= From: Giuseppe CAVALLARO Message-ID: Date: Tue, 7 Jun 2016 09:23:09 +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: <1464974960-26672-1-git-send-email-vpalatin@chromium.org> Content-Type: text/plain; charset="windows-1252"; 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-07_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Peppe > Signed-off-by: Vincent Palatin > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c > index 0cd3ecf..2e45e75 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c > @@ -534,6 +534,10 @@ static int rk_gmac_init(struct platform_device *pdev, void *priv) > struct rk_priv_data *bsp_priv = priv; > int ret; > > + /* Keep the PHY up if we use Wake-on-Lan. */ > + if (device_may_wakeup(&pdev->dev)) > + return 0; > + > ret = phy_power_on(bsp_priv, true); > if (ret) > return ret; > @@ -549,6 +553,10 @@ static void rk_gmac_exit(struct platform_device *pdev, void *priv) > { > struct rk_priv_data *gmac = priv; > > + /* The PHY was up for Wake-on-Lan. */ > + if (device_may_wakeup(&pdev->dev)) > + return; > + > phy_power_on(gmac, false); > gmac_clk_enable(gmac, false); > } >