summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2012-03-21 16:43:45 -0700
committerArve Hjønnevåg <arve@android.com>2012-03-21 17:31:29 -0700
commit6c3978c3f224e6b40ff9c981aae3c29a08e4ff4f (patch)
treedd39fdd8fcbd1d55b248e760280094ed352614e3
parent59c75bcf603f355ff34282422e8c3f2165b9d5f2 (diff)
Fix 3.3 merge error in: drivers: power: Add watchdog timer to catch drivers which lockup during suspend.
__device_suspend could return with an active timer on the stack Change-Id: I113f5f9aa12f909cb46621b6744e02a104ddd2bd Signed-off-by: Arve Hjønnevåg <arve@android.com>
-rw-r--r--drivers/base/power/main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 070ef58cc58..0d4212c9864 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -850,14 +850,6 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
dpm_wait_for_children(dev, async);
- data.dev = dev;
- data.tsk = get_current();
- init_timer_on_stack(&timer);
- timer.expires = jiffies + HZ * 12;
- timer.function = dpm_drv_timeout;
- timer.data = (unsigned long)&data;
- add_timer(&timer);
-
if (async_error)
return 0;
@@ -871,6 +863,14 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
return 0;
}
+ data.dev = dev;
+ data.tsk = get_current();
+ init_timer_on_stack(&timer);
+ timer.expires = jiffies + HZ * 12;
+ timer.function = dpm_drv_timeout;
+ timer.data = (unsigned long)&data;
+ add_timer(&timer);
+
device_lock(dev);
if (dev->pm_domain) {