mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: Vincent Palatin <vpalatin@chromium.org>, Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	"Alexandre Torgue" <alexandre.torgue@st.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Douglas Anderson" <dianders@chromium.org>
Subject: Re: [PATCH] net: stmmac: dwmac-rk: keep PHY up for WoL
Date: Fri, 10 Jun 2016 14:29:44 +0200	[thread overview]
Message-ID: <bd302fc6-feae-b99a-4632-a0ff9ead0123@st.com> (raw)
In-Reply-To: <CAP_ceTxad-7iaBDPbLShHv04uA-DWsVuGpbLc3=7gX2b060sYw@mail.gmail.com>

Hello Vincent

On 6/10/2016 1:00 AM, Vincent Palatin wrote:
> On Wed, Jun 8, 2016 at 5:17 PM, Andrew Lunn <andrew@lunn.ch> 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
>>> <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 ?
>>
>> 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

  reply	other threads:[~2016-06-10 12:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 17:29 Vincent Palatin
2016-06-06 20:45 ` Heiko Stübner
2016-06-06 21:00   ` Vincent Palatin
2016-06-07  7:23 ` Giuseppe CAVALLARO
2016-06-08 22:25   ` Vincent Palatin
2016-06-09  0:17     ` Andrew Lunn
2016-06-09 23:00       ` Vincent Palatin
2016-06-10 12:29         ` Giuseppe CAVALLARO [this message]
2016-06-11  1:00           ` net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Vincent Palatin
2016-06-11  1:00             ` [PATCH 1/3] net: stmmac: allow to split suspend/resume from init/exit callbacks Vincent Palatin
2016-06-11  1:16               ` David Miller
2016-06-11  1:00             ` [PATCH 2/3] net: stmmac: dwmac-rk: keep the PHY up for WoL Vincent Palatin
2016-06-11  1:57               ` Heiko Stuebner
2016-06-15 16:03                 ` Vincent Palatin
2016-06-15 18:32                   ` [PATCH v2 0/3] net: stmmac: dwmac-rk: fixes for Wake-on-Lan on RK3288 Vincent Palatin
2016-06-15 18:32                     ` [PATCH v2 1/3] net: stmmac: allow to split suspend/resume from init/exit callbacks Vincent Palatin
2016-06-15 18:32                     ` [PATCH v2 2/3] net: stmmac: dwmac-rk: keep the PHY up for WoL Vincent Palatin
2016-06-15 18:32                     ` [PATCH v2 3/3] ARM: dts: rockchip: add interrupt for Wake-on-Lan on RK3288 Vincent Palatin
2016-06-16 21:15                     ` [PATCH v2 0/3] net: stmmac: dwmac-rk: fixes " David Miller
2016-06-11  1:00             ` [PATCH 3/3] ARM: dts: rockchip: add interrupt " Vincent Palatin
2016-06-11  1:16             ` net: stmmac: dwmac-rk: fixes " David Miller
2016-06-13  6:46             ` Giuseppe CAVALLARO
2016-06-15 17:04               ` Vincent Palatin
2016-06-16 13:37                 ` Giuseppe CAVALLARO
2016-06-16 14:51                   ` Vincent Palatin
2016-06-17  5:38                     ` Giuseppe CAVALLARO

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bd302fc6-feae-b99a-4632-a0ff9ead0123@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=andrew@lunn.ch \
    --cc=dianders@chromium.org \
    --cc=heiko@sntech.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vpalatin@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®