Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1413371 > unrolled thread

[PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL

Started byVincent Palatin <vpalatin@chromium.org>
First post2016-06-03 19:30 +0200
Last post2016-06-17 07:40 +0200
Articles 6 on this page of 26 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL Vincent Palatin <vpalatin@chromium.org> - 2016-06-03 19:30 +0200
    Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL Heiko Stübner <heiko@sntech.de> - 2016-06-06 22:50 +0200
      Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL Vincent Palatin <vpalatin@chromium.org> - 2016-06-06 23:10 +0200
    Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2016-06-07 09:30 +0200
      Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL Vincent Palatin <vpalatin@chromium.org> - 2016-06-09 00:30 +0200
        Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL Andrew Lunn <andrew@lunn.ch> - 2016-06-09 02:20 +0200
          Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL Vincent Palatin <vpalatin@chromium.org> - 2016-06-10 01:10 +0200
            Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2016-06-10 14:30 +0200
              [PATCH 2/3] net: stmmac: dwmac-rk: keep the PHY up for WoL Vincent Palatin <vpalatin@chromium.org> - 2016-06-11 03:10 +0200
                Re: [PATCH 2/3] net: stmmac: dwmac-rk: keep the PHY up for WoL Heiko Stuebner <heiko@sntech.de> - 2016-06-11 04:00 +0200
                  Re: [PATCH 2/3] net: stmmac: dwmac-rk: keep the PHY up for WoL Vincent Palatin <vpalatin@chromium.org> - 2016-06-15 18:10 +0200
                    [PATCH v2 0/3] net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Vincent Palatin <vpalatin@chromium.org> - 2016-06-15 20:40 +0200
                      [PATCH v2 2/3] net: stmmac: dwmac-rk: keep the PHY up for WoL Vincent Palatin <vpalatin@chromium.org> - 2016-06-15 20:40 +0200
                      [PATCH v2 1/3] net: stmmac: allow to split suspend/resume from init/exit callbacks Vincent Palatin <vpalatin@chromium.org> - 2016-06-15 20:40 +0200
                      [PATCH v2 3/3] ARM: dts: rockchip: add interrupt for Wake-on-Lan on RK3288 Vincent Palatin <vpalatin@chromium.org> - 2016-06-15 20:40 +0200
                      Re: [PATCH v2 0/3] net: stmmac: dwmac-rk: fixes for Wake-on-Lan on  RK3288 David Miller <davem@davemloft.net> - 2016-06-16 23:20 +0200
              [PATCH 1/3] net: stmmac: allow to split suspend/resume from init/exit callbacks Vincent Palatin <vpalatin@chromium.org> - 2016-06-11 03:10 +0200
                Re: [PATCH 1/3] net: stmmac: allow to split suspend/resume from  init/exit callbacks David Miller <davem@davemloft.net> - 2016-06-11 03:20 +0200
              net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Vincent Palatin <vpalatin@chromium.org> - 2016-06-11 03:10 +0200
                [PATCH 3/3] ARM: dts: rockchip: add interrupt for Wake-on-Lan on RK3288 Vincent Palatin <vpalatin@chromium.org> - 2016-06-11 03:10 +0200
                Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 David Miller <davem@davemloft.net> - 2016-06-11 03:20 +0200
                Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2016-06-13 08:50 +0200
                  Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Vincent Palatin <vpalatin@chromium.org> - 2016-06-15 19:10 +0200
                    Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2016-06-16 15:40 +0200
                      Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Vincent Palatin <vpalatin@chromium.org> - 2016-06-16 17:00 +0200
                        Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2016-06-17 07:40 +0200

Page 2 of 2 — ← Prev page 1 [2]


#1419870 — Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288

FromDavid Miller <davem@davemloft.net>
Date2016-06-11 03:20 +0200
SubjectRe: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288
Message-ID<rIFKF-4QS-15@gated-at.bofh.it>
In reply to#1419862
From: Vincent Palatin <vpalatin@chromium.org>
Date: Fri, 10 Jun 2016 18:00:36 -0700

> 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.
> 

Ignore my previous email, but in the future please tag these postings
properly with "[PATCH 0/N] " at the beginning of the subject line.

Thanks.

[toc] | [prev] | [next] | [standalone]


#1420489 — Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288

FromGiuseppe CAVALLARO <peppe.cavallaro@st.com>
Date2016-06-13 08:50 +0200
SubjectRe: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288
Message-ID<rJtR8-2Bj-11@gated-at.bofh.it>
In reply to#1419862
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.

Peppe

[toc] | [prev] | [next] | [standalone]


#1423246 — Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288

FromVincent Palatin <vpalatin@chromium.org>
Date2016-06-15 19:10 +0200
SubjectRe: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288
Message-ID<rKmue-5m4-15@gated-at.bofh.it>
In reply to#1420489
On Sun, Jun 12, 2016 at 11:46 PM, Giuseppe CAVALLARO
<peppe.cavallaro@st.com> 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

[toc] | [prev] | [next] | [standalone]


#1424059 — Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288

FromGiuseppe CAVALLARO <peppe.cavallaro@st.com>
Date2016-06-16 15:40 +0200
SubjectRe: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288
Message-ID<rKFGy-vH-19@gated-at.bofh.it>
In reply to#1423246
Hi Vincent

On 6/15/2016 7:04 PM, Vincent Palatin wrote:
> On Sun, Jun 12, 2016 at 11:46 PM, Giuseppe CAVALLARO
> <peppe.cavallaro@st.com> 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 ?

I think this is mandatory otherwise you are not guaranteeing the PM
stuff working on the rest of the glue-logics (not only sti); because
init/exit calls won't be called anymore. So I kindly ask you to
propagate the fix and send the V3.  The implementation above is ok for
me.

peppe

[toc] | [prev] | [next] | [standalone]


#1424151 — Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288

FromVincent Palatin <vpalatin@chromium.org>
Date2016-06-16 17:00 +0200
SubjectRe: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288
Message-ID<rKGVY-1bI-25@gated-at.bofh.it>
In reply to#1424059
Hi Giuseppe,

On Thu, Jun 16, 2016 at 6:37 AM, Giuseppe CAVALLARO
<peppe.cavallaro@st.com> wrote:
>
> Hi Vincent
>
>
> On 6/15/2016 7:04 PM, Vincent Palatin wrote:
>>
>> On Sun, Jun 12, 2016 at 11:46 PM, Giuseppe CAVALLARO
>> <peppe.cavallaro@st.com> 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 ?
>
>
> I think this is mandatory otherwise you are not guaranteeing the PM
> stuff working on the rest of the glue-logics (not only sti); because
> init/exit calls won't be called anymore.


As mentioned in the PATCH 1/3 description: "If the driver does not
provide the suspend or resume callback, we fall
back to the old behavior trying to use exit or init. [...]"
ie.
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -411,7 +411,9 @@ static int stmmac_pltfr_suspend(struct device *dev)
        struct platform_device *pdev = to_platform_device(dev);

        ret = stmmac_suspend(dev);
-       if (priv->plat->exit)
+       if (priv->plat->suspend)
+               priv->plat->suspend(pdev, priv->plat->bsp_priv);
+       else if (priv->plat->exit)
                priv->plat->exit(pdev, priv->plat->bsp_priv);

        return ret;
@@ -430,7 +432,9 @@ static int stmmac_pltfr_resume(struct device *dev)
        struct stmmac_priv *priv = netdev_priv(ndev);
        struct platform_device *pdev = to_platform_device(dev);

-       if (priv->plat->init)
+       if (priv->plat->resume)
+               priv->plat->resume(pdev, priv->plat->bsp_priv);
+       else if (priv->plat->init)
                priv->plat->init(pdev, priv->plat->bsp_priv);

        return stmmac_resume(dev);

So I was under the impression that everything should continue working
as before for drivers only providing init/exit,
by falling back on calling ->exit() if there is no suspend() callback
initialized for the PM calls.
You think that won't work ?

>
> So I kindly ask you to
> propagate the fix and send the V3.  The implementation above is ok for
> me.
>
> peppe
>

[toc] | [prev] | [next] | [standalone]


#1424680 — Re: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288

FromGiuseppe CAVALLARO <peppe.cavallaro@st.com>
Date2016-06-17 07:40 +0200
SubjectRe: net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288
Message-ID<rKUFA-2px-33@gated-at.bofh.it>
In reply to#1424151
On 6/16/2016 4:51 PM, Vincent Palatin wrote:
> Hi Giuseppe,
>
> On Thu, Jun 16, 2016 at 6:37 AM, Giuseppe CAVALLARO
> <peppe.cavallaro@st.com> wrote:
>>
>> Hi Vincent
>>
>>
>> On 6/15/2016 7:04 PM, Vincent Palatin wrote:
>>>
>>> On Sun, Jun 12, 2016 at 11:46 PM, Giuseppe CAVALLARO
>>> <peppe.cavallaro@st.com> 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 ?
>>
>>
>> I think this is mandatory otherwise you are not guaranteeing the PM
>> stuff working on the rest of the glue-logics (not only sti); because
>> init/exit calls won't be called anymore.
>
>
> As mentioned in the PATCH 1/3 description: "If the driver does not
> provide the suspend or resume callback, we fall
> back to the old behavior trying to use exit or init. [...]"
> ie.
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -411,7 +411,9 @@ static int stmmac_pltfr_suspend(struct device *dev)
>         struct platform_device *pdev = to_platform_device(dev);
>
>         ret = stmmac_suspend(dev);
> -       if (priv->plat->exit)
> +       if (priv->plat->suspend)
> +               priv->plat->suspend(pdev, priv->plat->bsp_priv);
> +       else if (priv->plat->exit)
>                 priv->plat->exit(pdev, priv->plat->bsp_priv);
>
>         return ret;
> @@ -430,7 +432,9 @@ static int stmmac_pltfr_resume(struct device *dev)
>         struct stmmac_priv *priv = netdev_priv(ndev);
>         struct platform_device *pdev = to_platform_device(dev);
>
> -       if (priv->plat->init)
> +       if (priv->plat->resume)
> +               priv->plat->resume(pdev, priv->plat->bsp_priv);
> +       else if (priv->plat->init)
>                 priv->plat->init(pdev, priv->plat->bsp_priv);
>
>         return stmmac_resume(dev);
>
> So I was under the impression that everything should continue working
> as before for drivers only providing init/exit,
> by falling back on calling ->exit() if there is no suspend() callback
> initialized for the PM calls.
> You think that won't work ?

it's ok for me.

Peppe

>
>>
>> So I kindly ask you to
>> propagate the fix and send the V3.  The implementation above is ok for
>> me.
>>
>> peppe
>>
>

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web