diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2011-01-25 20:50:07 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-17 15:14:57 -0800 |
commit | 3e3742bc3d042533355fdc13dcec17deb5b584fa (patch) | |
tree | 851a14c8c74e81ff53ce5b27fdbbd0de6d7779ff /drivers | |
parent | c4a0895efdcbc8eb1799c6f749f1b6ae16159fdc (diff) |
PM / Runtime: Don't enable interrupts while running in_interrupt
commit c3810c88788d505d4ffd786addd111b745e42161 upstream.
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>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/power/runtime.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 02c652be83e7..6b2d4093b81b 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -404,12 +404,15 @@ static int rpm_suspend(struct device *dev, int rpmflags) goto out; } + /* Maybe the parent is now able to suspend. */ if (parent && !parent->power.ignore_children) { - spin_unlock_irq(&dev->power.lock); + spin_unlock(&dev->power.lock); - pm_request_idle(parent); + spin_lock(&parent->power.lock); + rpm_idle(parent, RPM_ASYNC); + spin_unlock(&parent->power.lock); - spin_lock_irq(&dev->power.lock); + spin_lock(&dev->power.lock); } out: |