Skip to content

Commit

Permalink
PM / Runtime: Don't enable interrupts while running in_interrupt
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Stern authored and Rafael J. Wysocki committed Jan 25, 2011
1 parent c723fda commit c3810c8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/base/power/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,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 && !dev->power.irq_safe) {
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:
Expand Down

0 comments on commit c3810c8

Please sign in to comment.