From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, Pavel Machek <pavel@ucw.cz>,
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>
Subject: Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and hibernation callbacks
Date: Fri, 21 Mar 2008 09:34:37 +1100 [thread overview]
Message-ID: <1206052477.8420.26.camel@pasglop> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0803201412210.22752-100000@netrider.rowland.org>
On Thu, 2008-03-20 at 14:26 -0400, Alan Stern wrote:
>
> One of the things we don't want to do is bind a new driver to a device
> after it has gone through the prepare() stage. Doing so would involve
> calling the driver's probe() routine, which is likely to want to
> register new children and who knows what else. The probe routine might
> even end up running after the device was suspended! Clearly this
> should be avoided.
>
> But the user can force a binding to occur by writing the device's path
> to the driver's "bind" attribute in sysfs. This means that
> driver_bind() in drivers/base/bus.c will need to know whether or not
> the device has gone through the prepare() stage, which means the device
> structure will need to have a flag set before prepare() is called (more
> precisely, the flag must be set before dev->sem is released following
> the call to prepare).
>
> Either that or else driver_bind() must always block whenever a system
> sleep is in progress. That would be easier -- but it's a lot like what
> the freezer would do. Which would you prefer?
I don't fully understand what you are saying here.
You say "bind a new driver to a device after it has gone through the
prepare() stage"
So either there was already a driver bound to that device, which got a
prepare() callback, and in which case bind() doesn't mean much. Or there
was not, in which case there was no prepare() call involved.
I suppose if you prepare(), then unbind(), then something tries to
bind()... But wouldn't the core flag set after prepare() be plenty
enough to shield against that ?
I fail to see the race you are talking about here.
Ben.
next prev parent reply other threads:[~2008-03-20 22:36 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-16 23:20 [RFC][PATCH 0/3] PM: Rework suspend and hibernation code for devices Rafael J. Wysocki
2008-03-16 23:22 ` [RFC][PATCH 1/3] PM: Introduce new top level suspend and hibernation callbacks Rafael J. Wysocki
2008-03-18 10:01 ` Pavel Machek
2008-03-18 15:10 ` Alan Stern
2008-03-18 23:54 ` Pavel Machek
2008-03-19 1:04 ` Rafael J. Wysocki
2008-03-19 2:44 ` Alan Stern
2008-03-19 3:49 ` Benjamin Herrenschmidt
2008-03-19 15:19 ` Alan Stern
2008-03-20 3:33 ` Benjamin Herrenschmidt
2008-03-20 14:45 ` Alan Stern
2008-03-20 22:32 ` Benjamin Herrenschmidt
2008-03-20 18:26 ` Alan Stern
2008-03-20 22:34 ` Benjamin Herrenschmidt [this message]
2008-03-20 22:57 ` Alan Stern
2008-03-19 0:53 ` Greg KH
2008-03-19 9:15 ` Pavel Machek
2008-03-19 13:22 ` Rafael J. Wysocki
2008-03-19 18:07 ` Greg KH
2008-03-16 23:24 ` [RFC][PATCH 2/3] PM: New suspend and hibernation callbacks for platform bus type Rafael J. Wysocki
2008-03-18 10:02 ` Pavel Machek
2008-03-16 23:25 ` [RFC][PATCH 3/3] PM: New suspend and hibernation callbacks for PCI " Rafael J. Wysocki
2008-03-18 10:02 ` Pavel Machek
2008-03-19 0:55 ` Greg KH
2008-03-19 13:24 ` Rafael J. Wysocki
2008-03-19 18:06 ` Greg KH
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=1206052477.8420.26.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=astarikovskiy@suse.de \
--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