lkml.org 
[lkml]   [2016]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL
    On Tue, Jun 7, 2016 at 12:23 AM, Giuseppe CAVALLARO
    <peppe.cavallaro@st.com> 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 ?


    >> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
    >> ---
    >> 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);
    >> }
    >>
    >

    \
     
     \ /
      Last update: 2016-06-09 01:01    [W:5.622 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site