From: David Brownell <david-b@pacbell.net>
To: Patrick Mochel <mochel@osdl.org>
Cc: linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: [patch 2.6.0-test7] PM resume must allow device removal
Date: Mon, 13 Oct 2003 09:36:55 -0700 [thread overview]
Message-ID: <3F8AD4A7.1040804@pacbell.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 727 bytes --]
Hi Patrick,
Here's a patch that resolves the PM problem I reported last week:
the self-deadlock during PM resume, in the case where devices
vanished during suspend. That's typical in certain OHCI-HCD
resume scenarios (where the HC loses power) and may eventually
happen in other cases, as drivers for hotpluggable buses become
more intelligent about things getting unplugged.
You may want to have a more elaborate fix. It looked to me like
that lock was overloaded ... it's serving not just to protect
the list of PM devices against concurrent changes, but also to
make sure only one task was managing PM suspend/resume. It
seems to me that the "one task" rule would better be handled
by some sort of state flag.
- Dave
[-- Attachment #2: pm-1013.patch --]
[-- Type: text/plain, Size: 552 bytes --]
--- 1.11/drivers/base/power/resume.c Mon Aug 25 11:08:21 2003
+++ edited/drivers/base/power/resume.c Fri Oct 10 21:06:07 2003
@@ -22,8 +22,17 @@
int resume_device(struct device * dev)
{
- if (dev->bus && dev->bus->resume)
- return dev->bus->resume(dev);
+ if (dev->bus && dev->bus->resume) {
+ int retval;
+
+ /* drop lock so the call can use device_del() to clean up
+ * after unplugged (or otherwise vanished) child devices
+ */
+ up(&dpm_sem);
+ retval = dev->bus->resume(dev);
+ down(&dpm_sem);
+ return retval;
+ }
return 0;
}
reply other threads:[~2003-10-13 16:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3F8AD4A7.1040804@pacbell.net \
--to=david-b@pacbell.net \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.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