mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"Linux-pm mailing list" <linux-pm@lists.linux-foundation.org>
Subject: Re: [RFC][PATCH 4/4] PM: Permit registrarion of parentless devices during system suspend
Date: Tue, 14 Dec 2010 00:05:49 +0100	[thread overview]
Message-ID: <201012140005.49193.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1012122253120.4379-100000@netrider.rowland.org>

On Monday, December 13, 2010, Alan Stern wrote:
> On Mon, 13 Dec 2010, Rafael J. Wysocki wrote:
> 
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > The registration of a new parentless device during system suspend
> > will not lead to any complications affecting the PM core (the device
> > will be effectively seen after the subsequent resume has completed),
> > so remove the code used for detection of such events.
> 
> Actually the tests you're changing were never as strong as they should
> have been.  Drivers are supposed to avoid registering new children
> beneath a device as soon as the device has gone through the "prepare"
> stage, not just after the device is suspended.  Should there be a 
> "prepared" bitflag to help implement this stronger test?

The in_suspend flag introduced by [3/4] works like this, actually.

> In principle the same idea applies to parentless devices, since they
> can be considered children of the "system device" (a fictitious node at
> the root of the device tree).  The "system" goes into the prepared
> state before all the real devices; that's what the transition_started
> variable was all about.  It's nothing more than the "prepared" bitflag
> for the "system device".

It has never worked like this, because it was cleared as early as at the
_noirq() stage.

Hmm.  It looks like I should modify [3/4] to clear the in_suspend flag earlier
to follow the current behavior (if a device is DPM_RESUMING, registration of
new children doesn't trigger the warning).

> I guess it's okay to be lenient and not check for this.  But should we
> then change the documentation to match?  (Note that the warning won't
> be triggered if a new child is registered _as_ the parent is
> suspending.  Not to mention the possibilities for mischief when devices
> are suspended asynchronously.  But as you say, these complications
> don't affect the PM core.)

The documentation is fine, I think, as it says what people are not supposed to
do and that doesn't really change. :-)

Thanks,
Rafael

  reply	other threads:[~2010-12-13 23:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13  0:28 [RFC][PATCH 0/4] PM: Use separate lists of devices at each stage of suspend/resume Rafael J. Wysocki
2010-12-13  0:29 ` [RFC][PATCH 1/4] PM: Use a different list of devices for each stage of device suspend Rafael J. Wysocki
2010-12-13  3:40   ` Alan Stern
2010-12-13  3:46     ` [linux-pm] " Alan Stern
2010-12-13  0:31 ` [RFC][PATCH 2/4] PM: Remove redundant checks from core device resume routines Rafael J. Wysocki
2010-12-13  1:34   ` Linus Torvalds
2010-12-13 22:58     ` Rafael J. Wysocki
2010-12-14 10:37     ` Ming Lei
2010-12-14 19:58       ` Rafael J. Wysocki
2010-12-15 14:12         ` Ming Lei
2010-12-13  0:32 ` [RFC][PATCH 3/4] PM: Replace the device power.status filed with a bit field Rafael J. Wysocki
2010-12-13  0:33 ` [RFC][PATCH 4/4] PM: Permit registrarion of parentless devices during system suspend Rafael J. Wysocki
2010-12-13  4:09   ` Alan Stern
2010-12-13 23:05     ` Rafael J. Wysocki [this message]
2010-12-14  3:19       ` Alan Stern
2010-12-14 20:02         ` Rafael J. Wysocki
2010-12-15  0:34         ` Rafael J. Wysocki
2010-12-15 20:58           ` Alan Stern
2010-12-13  1:35 ` [RFC][PATCH 0/4] PM: Use separate lists of devices at each stage of suspend/resume Linus Torvalds

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=201012140005.49193.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=stern@rowland.harvard.edu \
    --cc=torvalds@linux-foundation.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®