All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Linux PM list <linux-pm@vger.kernel.org>,
	Kevin Hilman <khilman@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Simon Horman <horms@verge.net.au>,
	Niklas Soderlund <niklas.soderlund+renesas@ragnatech.se>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 0/3] PM / core: Invent a WAKEUP_POWERED driver flag
Date: Thu, 9 Nov 2017 15:41:33 +0100	[thread overview]
Message-ID: <CAMuHMdUTX+=SfzivXz5HkgmrxcKB0miYnisBuy3iMtZNABS5KA@mail.gmail.com> (raw)
In-Reply-To: <CAPDyKFp6FYX-dLZJV6oto8Uc8e8KzO18ScTO8SU+8=NGbs7cOg@mail.gmail.com>

Hi Ulf,

On Thu, Nov 9, 2017 at 3:28 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> [...]
>
>>>> The Ethernet driver can still call device_set_wakeup_enable(... , false)
>>>> to control this.  If WoL is disabled by the user (or deemed not usable, see
>>>> below), it already does so.
>>>
>>> I don't think that API is intended to be used like that and I wonder
>>> if it even works as expected.
>>>
>>> Quoting the doc:
>>> "If device wakeup mechanisms are enabled or disabled directly by
>>> drivers, they also should use :c:func:`device_may_wakeup()` to decide what to do
>>> during a system sleep transition.  Device drivers, however, are not expected to
>>> call :c:func:`device_set_wakeup_enable()` directly in any case."
>>>
>>> Rafael, can you comment on this?
>>
>> There are ca. 100 callers in drivers.
>
> Yeah, but those doesn't normally use it to toggle the setting, but
> instead only to set a default value during ->probe() or whatever
> initialization code that runs.
>
> I think that makes a big difference, doesn't it?

The few Ethernet drivers I looked at change the state in their
ethtool_ops.set_wol() callback, not during probe.
This is to be configured from userspace using ethtool.

>>>> In addition, keeping WoL enabled for cases 1 and 2 may be desirable
>>>> (e.g allow wake-up if a cable is plugged in during system suspend and
>>>>  a magic packet is received afterwards), depending on the hardware.
>>>> But the driver can already control that through device_set_wakeup_enable().
>>>
>>> Ehh, that sounds weird. :-) If the Ethernet interface is down, how
>>> would such packet be received?
>>
>> It depends on your meaning of "up".  My interpretation is that "up" means
>> ready to handle packets between physical media and the Linux networking stack.
>>
>> So even when "down", the actual Ethernet controller may still be able to
>> receive a magic packet if WoL is enabled.  The magic packet is really a
>> magic packet not intended to be transmitted to the networking stack, but
>> merely serves as a wakeup signal.
>
> I see! So, in the end this seems like a combination of what the HW
> supports and what the user policy is set to.
>
> Out of curiosity, can you tell how those Renesas Ethernet devices
> works in this regards?

I don't know, I was just playing the devil's advocate ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2017-11-09 14:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 15:15 [PATCH 0/3] PM / core: Invent a WAKEUP_POWERED driver flag Ulf Hansson
2017-11-08 15:15 ` [PATCH 1/3] PM / core: Re-factor some code dealing with parents in __device_suspend() Ulf Hansson
2017-11-08 15:26   ` Geert Uytterhoeven
2017-11-08 15:15 ` [PATCH 2/3] PM / core: Add WAKEUP_POWERED driver flag Ulf Hansson
2017-11-08 15:32   ` Geert Uytterhoeven
2017-11-09  0:24   ` Rafael J. Wysocki
2017-11-09  8:44     ` Ulf Hansson
2017-11-09 11:40       ` Rafael J. Wysocki
2017-11-10  9:44         ` Ulf Hansson
2017-11-09  0:41   ` Rafael J. Wysocki
2017-11-09  8:53     ` Ulf Hansson
2017-11-09 11:51       ` Rafael J. Wysocki
2017-11-08 15:15 ` [PATCH 3/3] PM / Domains: Take WAKEUP_POWERED driver flag into account Ulf Hansson
2017-11-08 15:32   ` Geert Uytterhoeven
2017-11-08 15:41 ` [PATCH 0/3] PM / core: Invent a WAKEUP_POWERED driver flag Geert Uytterhoeven
2017-11-09  8:28   ` Ulf Hansson
2017-11-09  9:02     ` Geert Uytterhoeven
2017-11-09 10:08       ` Ulf Hansson
2017-11-09 10:14         ` Geert Uytterhoeven
2017-11-09 14:28           ` Ulf Hansson
2017-11-09 14:41             ` Geert Uytterhoeven [this message]
2017-11-09 16:31               ` Rafael J. Wysocki
2017-11-10  9:28                 ` Ulf Hansson
2017-11-09 11:59         ` Rafael J. Wysocki
2017-11-09 12:02           ` Rafael J. Wysocki

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='CAMuHMdUTX+=SfzivXz5HkgmrxcKB0miYnisBuy3iMtZNABS5KA@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=khilman@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@linaro.org \
    --cc=viresh.kumar@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.