public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't "lose" devices on suspend on failure
@ 2005-05-31  7:08 Benjamin Herrenschmidt
  2005-06-01 21:24 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2005-05-31  7:08 UTC (permalink / raw)
  To: Linux-pm mailing list; +Cc: Patrick Mochel, Greg KH, Linux Kernel list

Hi !

I think we need this patch or we might "lose" devices to the dpm_irq_off
list if a failure occurs during the suspend process.

Patrick, Greg, your opinion ?

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/drivers/base/power/suspend.c
===================================================================
--- linux-work.orig/drivers/base/power/suspend.c	2005-05-31 16:29:22.000000000 +1000
+++ linux-work/drivers/base/power/suspend.c	2005-05-31 16:57:29.000000000 +1000
@@ -113,8 +113,19 @@
 		put_device(dev);
 	}
 	up(&dpm_list_sem);
-	if (error)
+	if (error) {
+		/* we failed... before resuming, bring back devices from
+		 * dpm_off_irq list back to main dpm_off list, we do want
+		 * to call resume() on them, in case they partially suspended
+		 * despite returning -EAGAIN
+		 */
+		while (!list_empty(&dpm_off_irq)) {
+			struct list_head * entry = dpm_off_irq.next;
+			list_del(entry);
+			list_add(entry, &dpm_off);
+		}
 		dpm_resume();
+	}
 	up(&dpm_sem);
 	return error;
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Don't "lose" devices on suspend on failure
  2005-05-31  7:08 [PATCH] Don't "lose" devices on suspend on failure Benjamin Herrenschmidt
@ 2005-06-01 21:24 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2005-06-01 21:24 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Linux-pm mailing list, Patrick Mochel, Linux Kernel list

On Tue, May 31, 2005 at 05:08:49PM +1000, Benjamin Herrenschmidt wrote:
> Hi !
> 
> I think we need this patch or we might "lose" devices to the dpm_irq_off
> list if a failure occurs during the suspend process.
> 
> Patrick, Greg, your opinion ?

Looks fine to me, I've added it to my tree.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-01 21:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-31  7:08 [PATCH] Don't "lose" devices on suspend on failure Benjamin Herrenschmidt
2005-06-01 21:24 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox