public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Nigel Cunningham <ncunningham@crca.org.au>,
	LKML <linux-kernel@vger.kernel.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	Alexey Starikovskiy <astarikovskiy@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/3] PM: Introduce new top level suspend and	hibernation callbacks (rev. 8)
Date: Tue, 15 Apr 2008 06:48:50 +1000	[thread overview]
Message-ID: <1208206130.6958.178.camel@pasglop> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0804141105460.2406-100000@iolanthe.rowland.org>


On Mon, 2008-04-14 at 11:13 -0400, Alan Stern wrote:
> On Mon, 14 Apr 2008, Rafael J. Wysocki wrote:
> 
> >     "you can assume that the user space is there while ->prepare() is running,
> >     but you are supposed to prevent new children of the device from being
> >     registered from that point on _and_ you have to make sure that freezable
> >     tasks will be able to freeze after ->prepare() has run" (but why on Earth a
> >     driver writer is now required to know what's a freezable task etc.?)
> 
> This reminds me...  We're going to need a way to make certain
> activities mutually exclusive with system sleep.  The simplest example
> is loading a kernel module; init and probe routines often end up
> causing new child devices to be registered.
> 
> The most straightforward approach is to use an rwsem like the one we 
> used to have.  However I'm concerned that under some circumstances 
> there might be recursive read-locking.  (For example, the init routine 
> in a newly-loaded module decides to load yet another module.  Can this 
> actually happen?  libusual does something much like it.)
> 
> So it's quite possible we'll end up needing a mechanism that resembles 
> an rwsem but allows recursive (properly nested) read-locking.  Does 
> such a thing exist already, or would it have to be invented?

Despite what Oliver says, that's a perfect example where the module load
syscalls should return an error. Maybe something like -EAGAIN would do
tho... that might need a minor update of the module init tools so they
retry instead of failing.

Ben.

       reply	other threads:[~2008-04-14 20:48 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44L0.0804141105460.2406-100000@iolanthe.rowland.org>
2008-04-14 20:48 ` Benjamin Herrenschmidt [this message]
     [not found] <Pine.LNX.4.44L0.0804141043001.2236-100000@iolanthe.rowland.org>
2008-04-14 20:41 ` [PATCH 1/3] PM: Introduce new top level suspend and hibernation callbacks (rev. 8) Oliver Neukum
     [not found] <200804141411.19385.rjw@sisk.pl>
2008-04-14 15:13 ` Alan Stern
     [not found] <Pine.LNX.4.44L0.0804131916420.3060-100000@netrider.rowland.org>
2008-04-13 23:33 ` Rafael J. Wysocki
2008-04-13 23:48 ` Benjamin Herrenschmidt
     [not found] ` <200804140133.23781.rjw@sisk.pl>
2008-04-13 23:49   ` Benjamin Herrenschmidt
     [not found] ` <1208130513.6958.72.camel@pasglop>
2008-04-14  0:07   ` Rafael J. Wysocki
     [not found]   ` <200804140207.19340.rjw@sisk.pl>
2008-04-14  0:40     ` Benjamin Herrenschmidt
2008-04-14  0:43     ` Benjamin Herrenschmidt
     [not found]     ` <1208133790.6958.89.camel@pasglop>
2008-04-14  0:50       ` Rafael J. Wysocki
     [not found]     ` <1208133631.6958.85.camel@pasglop>
2008-04-14  0:59       ` Rafael J. Wysocki
     [not found] <200804040111.15255.rjw@sisk.pl>
     [not found] ` <20080412002302.GA27656@kroah.com>
     [not found]   ` <200804131531.11650.rjw@sisk.pl>
2008-04-13 13:33     ` Rafael J. Wysocki
     [not found]     ` <200804131533.03150.rjw@sisk.pl>
2008-04-13 21:05       ` Benjamin Herrenschmidt
2008-04-13 21:39         ` Rafael J. Wysocki
     [not found]         ` <200804132339.45280.rjw@sisk.pl>
2008-04-13 22:10           ` Benjamin Herrenschmidt
     [not found]           ` <1208124646.6958.61.camel@pasglop>
2008-04-13 22:27             ` Rafael J. Wysocki
     [not found]             ` <200804140027.12161.rjw@sisk.pl>
2008-04-13 22:47               ` Benjamin Herrenschmidt
     [not found]               ` <1208126822.6958.63.camel@pasglop>
2008-04-13 23:08                 ` Rafael J. Wysocki
2008-04-13 23:11                 ` Nigel Cunningham
     [not found]                 ` <1208128289.29577.25.camel@nigel-laptop>
2008-04-13 23:17                   ` Rafael J. Wysocki
2008-04-13 23:23                   ` Alan Stern
     [not found]                   ` <200804140117.34554.rjw@sisk.pl>
2008-04-13 23:29                     ` Nigel Cunningham
     [not found]                 ` <200804140108.05447.rjw@sisk.pl>
2008-04-13 23:46                   ` Benjamin Herrenschmidt
     [not found]                   ` <1208130390.6958.71.camel@pasglop>
2008-04-14  0:31                     ` Rafael J. Wysocki
     [not found]                     ` <200804140231.32245.rjw@sisk.pl>
2008-04-14  0:46                       ` Benjamin Herrenschmidt
     [not found]                       ` <1208134017.6958.94.camel@pasglop>
2008-04-14  1:09                         ` Rafael J. Wysocki
2008-04-14  1:37                         ` Nigel Cunningham
     [not found]                         ` <200804140309.22057.rjw@sisk.pl>
2008-04-14  3:23                           ` Benjamin Herrenschmidt
     [not found]                           ` <1208143380.6958.105.camel@pasglop>
2008-04-14  6:43                             ` Oliver Neukum
     [not found]                             ` <200804140843.06088.oliver@neukum.org>
2008-04-14  7:23                               ` Benjamin Herrenschmidt
2008-04-14  7:37                                 ` Oliver Neukum
     [not found]                                 ` <200804140937.09915.oliver@neukum.org>
2008-04-14  7:50                                   ` Benjamin Herrenschmidt
2008-04-14 12:11                             ` Rafael J. Wysocki
2008-04-14 14:49                             ` Alan Stern
     [not found]                         ` <1208137034.29577.41.camel@nigel-laptop>
2008-04-14 12:25                           ` Rafael J. Wysocki
2008-04-14  4:47                 ` David Brownell
2008-04-14 10:55                 ` Pavel Machek
     [not found]                 ` <200804132147.03579.david-b@pacbell.net>
2008-04-14 12:34                   ` Rafael J. Wysocki
2008-04-14 14:51                   ` Alan Stern
     [not found]                   ` <Pine.LNX.4.44L0.0804141049370.2236-100000@iolanthe.rowland.org>
2008-04-14 20:47                     ` Benjamin Herrenschmidt
2008-04-14 21:21                     ` Pavel Machek
     [not found]                 ` <20080414105522.GA4716@ucw.cz>
2008-04-14 20:45                   ` Benjamin Herrenschmidt
2008-04-14 20:56                     ` 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=1208206130.6958.178.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=akpm@linux-foundation.org \
    --cc=astarikovskiy@suse.de \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=ncunningham@crca.org.au \
    --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