From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753654AbcFOREi (ORCPT ); Wed, 15 Jun 2016 13:04:38 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:36702 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753474AbcFOREd (ORCPT ); Wed, 15 Jun 2016 13:04:33 -0400 MIME-Version: 1.0 In-Reply-To: <3d278dd6-0b61-f618-b723-52f9c302c999@st.com> References: <1465606839-7722-1-git-send-email-vpalatin@chromium.org> <3d278dd6-0b61-f618-b723-52f9c302c999@st.com> From: Vincent Palatin Date: Wed, 15 Jun 2016 10:04:06 -0700 X-Google-Sender-Auth: 0-wUrfh4k9ifljqY4EehWYQfKI4 Message-ID: Subject: Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 To: Giuseppe CAVALLARO Cc: netdev@vger.kernel.org, LKML , Andrew Lunn , Douglas Anderson , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Shunqian Zheng , David Miller Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 12, 2016 at 11:46 PM, Giuseppe CAVALLARO wrote: > On 6/11/2016 3:00 AM, Vincent Palatin wrote: >> >> In order to support Wake-On-Lan when using the RK3288 integrated MAC >> (with an external RGMII PHY), we need to avoid shutting down the regulator >> of the external PHY when the MAC is suspended as it's currently done in >> the MAC >> platform code. >> As a first step, create independant callbacks for suspend/resume rather >> than >> re-using exit/init callbacks. So the dwmac platform driver can behave >> differently >> on suspend where it might skip shutting the PHY and at module unloading. >> Then update the dwmac-rk driver to switch off the PHY regulator only if we >> are >> not planning to wake up from the LAN. >> Finally add the PMT interrupt to the MAC device tree configuration, so we >> can >> wake up the core from it when the PHY has received the magic packet. > > > IMO these could be sent for net-next and also other glue logic > files should be reworked in order to use the new API for coherence. Given they will have the same set of functions for exit/init and suspend/resume, you mean duplicating the callbacks like this : --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c @@ -359,6 +359,8 @@ static int sti_dwmac_probe(struct platform_device *pdev) plat_dat->bsp_priv = dwmac; plat_dat->init = sti_dwmac_init; plat_dat->exit = sti_dwmac_exit; + plat_dat->suspend = sti_dwmac_exit; + plat_dat->resume = sti_dwmac_init; plat_dat->fix_mac_speed = data->fix_retime_src; ret = sti_dwmac_init(pdev, plat_dat->bsp_priv); Is this anyhow useful ? -- Vincent