aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2011-01-25 14:50:07 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-01-25 14:50:07 -0500
commitc3810c88788d505d4ffd786addd111b745e42161 (patch)
treecc70c4e1ec62adb4f51cf7e1f45ed296a0475f04 /drivers/base
parentc723fdab8aa728dc2bf0da6a0de8bb9c3f588d84 (diff)
PM / Runtime: Don't enable interrupts while running in_interrupt
This patch (as1445) fixes a bug in the runtime PM core left over from the addition of the no_callbacks flag. If this flag is set then it is possible for rpm_suspend() to be called in_interrupt, so when releasing spinlocks it's important not to re-enable interrupts. To avoid an unnecessary save-and-restore of the interrupt flag, the patch also inlines a pm_request_idle() call. This fixes Bugzilla #27482. (The offending code was added in 2.6.37, so it's not necessary to apply this to any earlier stable kernels.) Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: tim blechmann <tim@klingt.org> CC: <stable@kernel.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/runtime.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 656493a5e073..42615b419dfb 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -407,12 +407,15 @@ static int rpm_suspend(struct device *dev, int rpmflags)
407 goto out; 407 goto out;
408 } 408 }
409 409
410 /* Maybe the parent is now able to suspend. */
410 if (parent && !parent->power.ignore_children && !dev->power.irq_safe) { 411 if (parent && !parent->power.ignore_children && !dev->power.irq_safe) {
411 spin_unlock_irq(&dev->power.lock); 412 spin_unlock(&dev->power.lock);
412 413
413 pm_request_idle(parent); 414 spin_lock(&parent->power.lock);
415 rpm_idle(parent, RPM_ASYNC);
416 spin_unlock(&parent->power.lock);
414 417
415 spin_lock_irq(&dev->power.lock); 418 spin_lock(&dev->power.lock);
416 } 419 }
417 420
418 out: 421 out: