All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Linux PM <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>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 1/3] PM / core: Assign the wakeup_path status flag in __device_prepare()
Date: Fri, 22 Dec 2017 20:12:16 +0100	[thread overview]
Message-ID: <1742152.iLm4rp6jIy@aspire.rjw.lan> (raw)
In-Reply-To: <CAPDyKFqa5Lt6jrDQd+V_cE+Bz2ZRJRe95-8bbJgV=LbkGPM0mw@mail.gmail.com>

On Thursday, December 21, 2017 11:13:57 AM CET Ulf Hansson wrote:
> On 21 December 2017 at 02:43, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > On Fri, Dec 15, 2017 at 4:56 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >> The PM core in the device_prepare() phase, resets the wakeup_path status
> >> flag to the value of device_may_wakeup(). This means if a ->prepare() or a
> >> ->suspend() callback for the device would update the device's wakeup
> >> setting, this doesn't become reflected in the wakeup_path status flag.
> >>
> >> In general this isn't a problem, because wakeup settings isn't supposed to
> >> be changed during those system suspend phases. Nevertheless, there are a
> >> cases not conforming to that behaviour, as device_set_wakeup_enable() is
> >> indeed called from ->suspend() callbacks.
> >
> > And why is this regarded as correct?
> 
> I am not saying that this behavior is correct. However, I am trying to
> improve the situation, which doesn't hurt or does it?

Adding a workaround for them kind of encourages new code to do the same
thing, which actually may really hurt.  So I assume that these call sites are
all legacy and that's why you don't want to touch them for now, but in that
case the commit message should make it very clear that this is about legacy
only and new code should not call device_set_wakeup_enable() during suspend.

[Something should be printed to the log if wakeup source objects
are created while system suspend is in progress I guess or similar.]

> More importantly, the next patch, which is about the wakeup path,
> depends on this.

Honestly, this sounds like "We have this change we really really would like to
make, but there's incorrect code getting in the way, so let's paper over it
and be done."  Not very nice. :-/

How many drivers actually do call device_set_wakeup_enable() during suspend?

Thanks,
Rafael

  reply	other threads:[~2017-12-22 19:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15 15:56 [PATCH 0/3] PM / core: Extend behaviour for wakeup paths Ulf Hansson
2017-12-15 15:56 ` [PATCH 1/3] PM / core: Assign the wakeup_path status flag in __device_prepare() Ulf Hansson
2017-12-21  1:43   ` Rafael J. Wysocki
2017-12-21 10:13     ` Ulf Hansson
2017-12-22 19:12       ` Rafael J. Wysocki [this message]
2017-12-23 12:03         ` Ulf Hansson
2017-12-23 12:50           ` Rafael J. Wysocki
2017-12-23 12:55             ` Rafael J. Wysocki
2017-12-23 15:17               ` Ulf Hansson
2017-12-26  0:36                 ` Rafael J. Wysocki
2017-12-15 15:56 ` [PATCH 2/3] PM / core: Add WAKEUP_PATH driver flag Ulf Hansson
2017-12-15 15:56 ` [PATCH 3/3] PM / Domains: Take WAKEUP_PATH driver flag into account in genpd Ulf Hansson
2017-12-15 16:02   ` Ulf Hansson

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=1742152.iLm4rp6jIy@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --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=rafael@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.guittot@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.