All of lore.kernel.org
 help / color / mirror / Atom feed
* 2.6.7-rc1-mm1: revert leave-runtime-suspended-devices-off-at-system-resume.patch
@ 2004-05-27 11:49 Felipe Alfaro Solana
  2004-05-27 23:34 ` Todd Poynor
  0 siblings, 1 reply; 6+ messages in thread
From: Felipe Alfaro Solana @ 2004-05-27 11:49 UTC (permalink / raw)
  To: Kernel Mailinglist, Andrew Morton

Andrew,

2.6.7-rc-mm1 includes
"leave-runtime-suspended-devices-off-at-system-resume" which causes
mayor problems when used on my ACPI laptop. After resuming from S3
(STR), both the CardBus and UHCI-HCD bridges won't come up from
suspension, rendering them completely unusable: neither my CardBus NIC,
nor my USB mouse are recognized or functional.

I can easily see this by looking at my Microsoft Intellimouse Explorer
optical mouse: the lights at the bottom of the mouse (used by the
optical sensors) are turned off, which means the device is not being
detected by the USB subsystem.

This behavior causes problems at system shutdown. The system hangs when
the rc.d scripts start stopping "hotplug". The system will hang at that
point without making any further progress since both the CardBus and USB
sybsystems are literally "frozen" (and I can't unload their modules by
hand).

Reverting "leave-runtime-suspend-devices-off-at-system-resume.patch"
fixes the problem for me.

Thanks.


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

* Re: 2.6.7-rc1-mm1: revert leave-runtime-suspended-devices-off-at-system-resume.patch
  2004-05-27 11:49 2.6.7-rc1-mm1: revert leave-runtime-suspended-devices-off-at-system-resume.patch Felipe Alfaro Solana
@ 2004-05-27 23:34 ` Todd Poynor
  2004-05-28 11:03   ` Felipe Alfaro Solana
  0 siblings, 1 reply; 6+ messages in thread
From: Todd Poynor @ 2004-05-27 23:34 UTC (permalink / raw)
  To: Felipe Alfaro Solana; +Cc: Kernel Mailinglist, Andrew Morton

On Thu, May 27, 2004 at 01:49:12PM +0200, Felipe Alfaro Solana wrote:
> 
> 2.6.7-rc-mm1 includes
> "leave-runtime-suspended-devices-off-at-system-resume" which causes
> mayor problems when used on my ACPI laptop. After resuming from S3
> (STR), both the CardBus and UHCI-HCD bridges won't come up from
> suspension, rendering them completely unusable: neither my CardBus NIC,
> nor my USB mouse are recognized or functional.

Aargh, USB drivers appear to be the only drivers to modify that field, I
didn't catch that, sorry.  The following patch against 2.6.6 adds a new
field for "previous state", so that drivers that modify their own
dev->power.power_state during the suspend callback will be resumed.  Can
send a patch to fix 2.6.7-rc1-mm1 if desired.

--- linux-2.6.6-orig/drivers/base/power/suspend.c	2004-05-10 11:22:58.000000000 -0700
+++ linux-2.6.6-prevstate/drivers/base/power/suspend.c	2004-05-27 13:58:01.931014888 -0700
@@ -39,7 +39,9 @@
 {
 	int error = 0;
 
-	if (dev->bus && dev->bus->suspend)
+	dev->power.prev_state = dev->power.power_state;
+
+	if (dev->bus && dev->bus->suspend && ! dev->power.power_state)
 		error = dev->bus->suspend(dev,state);
 
 	if (!error) {
--- linux-2.6.6-orig/drivers/base/power/resume.c	2004-05-10 11:22:58.000000000 -0700
+++ linux-2.6.6-prevstate/drivers/base/power/resume.c	2004-05-27 14:35:03.373304328 -0700
@@ -35,7 +35,10 @@
 		struct list_head * entry = dpm_off.next;
 		struct device * dev = to_device(entry);
 		list_del_init(entry);
-		resume_device(dev);
+
+		if (! dev->power.prev_state)
+			resume_device(dev);
+
 		list_add_tail(entry,&dpm_active);
 	}
 }
--- linux-2.6.6-orig/include/linux/pm.h	2004-05-10 11:23:56.000000000 -0700
+++ linux-2.6.6-prevstate/include/linux/pm.h	2004-05-27 14:35:37.143170528 -0700
@@ -231,6 +231,7 @@
 struct dev_pm_info {
 #ifdef	CONFIG_PM
 	u32			power_state;
+	u32			prev_state;
 	u8			* saved_state;
 	atomic_t		pm_users;
 	struct device		* pm_parent;


-- 
Todd

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

* Re: 2.6.7-rc1-mm1: revert leave-runtime-suspended-devices-off-at-system-resume.patch
  2004-05-27 23:34 ` Todd Poynor
@ 2004-05-28 11:03   ` Felipe Alfaro Solana
  2004-05-28 18:54     ` Todd Poynor
  0 siblings, 1 reply; 6+ messages in thread
From: Felipe Alfaro Solana @ 2004-05-28 11:03 UTC (permalink / raw)
  To: Todd Poynor; +Cc: Kernel Mailinglist, Andrew Morton

On Fri, 2004-05-28 at 01:34, Todd Poynor wrote:

> > 2.6.7-rc-mm1 includes
> > "leave-runtime-suspended-devices-off-at-system-resume" which causes
> > mayor problems when used on my ACPI laptop. After resuming from S3
> > (STR), both the CardBus and UHCI-HCD bridges won't come up from
> > suspension, rendering them completely unusable: neither my CardBus NIC,
> > nor my USB mouse are recognized or functional.
> 
> Aargh, USB drivers appear to be the only drivers to modify that field, I
> didn't catch that, sorry.  The following patch against 2.6.6 adds a new
> field for "previous state", so that drivers that modify their own
> dev->power.power_state during the suspend callback will be resumed.  Can
> send a patch to fix 2.6.7-rc1-mm1 if desired.

I would like to see the patch against 2.6.7-rc1-mm1.
Thanks!


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

* Re: 2.6.7-rc1-mm1: revert leave-runtime-suspended-devices-off-at-system-resume.patch
  2004-05-28 11:03   ` Felipe Alfaro Solana
@ 2004-05-28 18:54     ` Todd Poynor
  2004-05-28 20:20       ` Greg KH
  2004-05-28 21:17       ` Felipe Alfaro Solana
  0 siblings, 2 replies; 6+ messages in thread
From: Todd Poynor @ 2004-05-28 18:54 UTC (permalink / raw)
  To: Felipe Alfaro Solana, Andrew Morton, greg; +Cc: Kernel Mailinglist

A patch to fix my previous
leave-runtime-suspended-devices-off-at-system-resume patch; the new
changes save a copy of power.power_state in order to know whether to
resume a device, independently of mods to that field by a driver suspend
routine.  This fixes 2.6.7-rc1-mm1 in the same fashion as the updated
2.6.6 patch sent previously.  Thanks -- Todd

--- linux-2.6.7-rc1-mm1.orig/drivers/base/power/suspend.c	2004-05-27 12:18:53.000000000 -0700
+++ linux-2.6.7-rc1-mm1.pm/drivers/base/power/suspend.c	2004-05-28 11:08:10.486982568 -0700
@@ -39,6 +39,8 @@
 {
 	int error = 0;
 
+	dev->power.prev_state = dev->power.power_state;
+
 	if (dev->bus && dev->bus->suspend && !dev->power.power_state)
 		error = dev->bus->suspend(dev,state);
 
--- linux-2.6.7-rc1-mm1.orig/drivers/base/power/resume.c	2004-05-27 12:18:53.000000000 -0700
+++ linux-2.6.7-rc1-mm1.pm/drivers/base/power/resume.c	2004-05-28 11:10:43.792676560 -0700
@@ -36,7 +36,7 @@
 		struct device * dev = to_device(entry);
 		list_del_init(entry);
 
-		if (!dev->power.power_state)
+		if (!dev->power.prev_state)
 			resume_device(dev);
 
 		list_add_tail(entry,&dpm_active);
--- linux-2.6.7-rc1-mm1.orig/include/linux/pm.h	2004-05-27 12:16:59.000000000 -0700
+++ linux-2.6.7-rc1-mm1.pm/include/linux/pm.h	2004-05-28 11:11:50.792491040 -0700
@@ -231,6 +231,7 @@
 struct dev_pm_info {
 	u32			power_state;
 #ifdef	CONFIG_PM
+	u32			prev_state;
 	u8			* saved_state;
 	atomic_t		pm_users;
 	struct device		* pm_parent;

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

* Re: 2.6.7-rc1-mm1: revert leave-runtime-suspended-devices-off-at-system-resume.patch
  2004-05-28 18:54     ` Todd Poynor
@ 2004-05-28 20:20       ` Greg KH
  2004-05-28 21:17       ` Felipe Alfaro Solana
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2004-05-28 20:20 UTC (permalink / raw)
  To: Todd Poynor; +Cc: Felipe Alfaro Solana, Andrew Morton, Kernel Mailinglist

On Fri, May 28, 2004 at 11:54:59AM -0700, Todd Poynor wrote:
> A patch to fix my previous
> leave-runtime-suspended-devices-off-at-system-resume patch; the new
> changes save a copy of power.power_state in order to know whether to
> resume a device, independently of mods to that field by a driver suspend
> routine.  This fixes 2.6.7-rc1-mm1 in the same fashion as the updated
> 2.6.6 patch sent previously.  Thanks -- Todd

Applied to my trees, thanks.

greg k-h

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

* Re: 2.6.7-rc1-mm1: revert leave-runtime-suspended-devices-off-at-system-resume.patch
  2004-05-28 18:54     ` Todd Poynor
  2004-05-28 20:20       ` Greg KH
@ 2004-05-28 21:17       ` Felipe Alfaro Solana
  1 sibling, 0 replies; 6+ messages in thread
From: Felipe Alfaro Solana @ 2004-05-28 21:17 UTC (permalink / raw)
  To: Todd Poynor; +Cc: Andrew Morton, greg, Kernel Mailinglist

On Fri, 2004-05-28 at 20:54, Todd Poynor wrote:
> A patch to fix my previous
> leave-runtime-suspended-devices-off-at-system-resume patch; the new
> changes save a copy of power.power_state in order to know whether to
> resume a device, independently of mods to that field by a driver suspend
> routine.  This fixes 2.6.7-rc1-mm1 in the same fashion as the updated
> 2.6.6 patch sent previously.  Thanks -- Todd

This one works flawlessly.
Thanks!


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

end of thread, other threads:[~2004-05-28 21:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-27 11:49 2.6.7-rc1-mm1: revert leave-runtime-suspended-devices-off-at-system-resume.patch Felipe Alfaro Solana
2004-05-27 23:34 ` Todd Poynor
2004-05-28 11:03   ` Felipe Alfaro Solana
2004-05-28 18:54     ` Todd Poynor
2004-05-28 20:20       ` Greg KH
2004-05-28 21:17       ` Felipe Alfaro Solana

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.