public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	pm list <linux-pm@lists.linux-foundation.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Greg KH <greg@kroah.com>, Len Brown <lenb@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Alexey Starikovskiy <astarikovskiy@suse.de>,
	David Brownell <david-b@pacbell.net>, Pavel Machek <pavel@ucw.cz>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [RFC][PATCH] PM: Introduce new top level suspend and hibernation callbacks (rev. 3)
Date: Tue, 25 Mar 2008 14:37:16 +0100	[thread overview]
Message-ID: <200803251437.17268.oliver@neukum.org> (raw)
In-Reply-To: <200803251340.55210.rjw@sisk.pl>

Am Dienstag, 25. März 2008 13:40:53 schrieb Rafael J. Wysocki:
> On Tuesday, 25 of March 2008, Oliver Neukum wrote:
> > Am Montag 24 März 2008 schrieb Rafael J. Wysocki:

> > > + *     after @prepare() returns.  If @prepare() detects a situation it cannot
> > > + *     handle (e.g. registration of a child already in progress), it may return
> > > + *     -EAGAIN, so that the PM core can execute it once again (e.g. after the
> > > + *     new child has been registered) to recover from the race condition. This
> > > + *     method is executed for all kinds of suspend transitions and is followed
> > > + *     by one of the suspend callbacks: @suspend(), @freeze(), or @poweroff().
> > 
> > This could be understood so that disconnect() cannot be called.
> 
> At what time exactly?

I see no locking that would would prevent disconnect() in the window between
prepare() and suspend()/...
  
> > > + *     The PM core executes @prepare() for all devices before starting to
> > > + *     execute suspend callbacks for any of them, so drivers may assume all of
> > > + *     the other devices to be present and functional while @prepare() is being
> > > + *     executed.  However, they may NOT assume anything about the availability
> > > + *     of the user space at that time.
> > 
> > Probably it should be mentioned that this is the time to allocate memory
> > if you have to.
> 
> Well, not exactly.  Afterwards you cannot use GFP_KERNEL allocations, but
> GFP_NOIO should still work, although for hibernation it's quite possible that
> they'll fail if substantial amounts of memory are requested.
> 
> > And it is too late to request firmware. 
> 
> Yes.

This is better documented explicitly.

	Regards
		Oliver

  reply	other threads:[~2008-03-25 13:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24 17:39 [RFC][PATCH] PM: Introduce new top level suspend and hibernation callbacks (rev. 3) Rafael J. Wysocki
2008-03-24 20:14 ` Alan Stern
2008-03-24 21:18   ` Rafael J. Wysocki
2008-03-25 15:06     ` Alan Stern
2008-03-25 20:35       ` Rafael J. Wysocki
2008-03-26 14:03         ` Alan Stern
2008-03-26 20:26           ` Rafael J. Wysocki
2008-03-26 20:36             ` Alan Stern
2008-03-26 20:54               ` Rafael J. Wysocki
2008-03-24 22:18   ` Rafael J. Wysocki
2008-03-25 11:55     ` Oliver Neukum
2008-03-25 12:40       ` Rafael J. Wysocki
2008-03-25 13:37         ` Oliver Neukum [this message]
2008-03-25 14:24           ` Alan Stern
2008-03-25 14:29         ` Alan Stern
2008-03-25 15:12     ` Alan Stern
2008-03-25 20:39       ` 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=200803251437.17268.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=astarikovskiy@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    /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