All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2.6.0-test7] PM resume must allow device removal
@ 2003-10-13 16:36 David Brownell
  0 siblings, 0 replies; only message in thread
From: David Brownell @ 2003-10-13 16:36 UTC (permalink / raw)
  To: Patrick Mochel; +Cc: linux-kernel, Greg KH

[-- 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;
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-13 16:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-13 16:36 [patch 2.6.0-test7] PM resume must allow device removal David Brownell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.