Commit 9e6b95c3 authored by Todd Poynor's avatar Todd Poynor Committed by Greg Kroah-Hartman

[PATCH] Fix for leave-runtime-suspended-devices-off-at-system-resume.patch

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.
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 5bb8ea44
......@@ -36,7 +36,7 @@ void dpm_resume(void)
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);
......
......@@ -41,6 +41,8 @@ int suspend_device(struct device * dev, u32 state)
dev_dbg(dev, "suspending\n");
dev->power.prev_state = dev->power.power_state;
if (dev->bus && dev->bus->suspend && !dev->power.power_state)
error = dev->bus->suspend(dev,state);
......
......@@ -231,6 +231,7 @@ struct device;
struct dev_pm_info {
u32 power_state;
#ifdef CONFIG_PM
u32 prev_state;
u8 * saved_state;
atomic_t pm_users;
struct device * pm_parent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment