Messages in this thread Patch in this message | | | Date | Thu, 27 May 2004 16:34:32 -0700 | From | Todd Poynor <> | Subject | Re: 2.6.7-rc1-mm1: revert leave-runtime-suspended-devices-off-at-system-resume.patch |
| |
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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |