From aa623665349764c70be6aaf77cc02e7b896d8848 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Fri, 5 Aug 2011 21:45:20 +0200 Subject: [PATCH] --- yaml --- r: 262627 b: refs/heads/master c: 02b26774afebb2d62695ba3230319d70d8c6cc2d h: refs/heads/master i: 262625: 82f48ab31bd0a4fdf8338ca9ecb514231627b7d7 262623: d998ad965cb69248b2bbba9af69fde78c3fec152 v: v3 --- [refs] | 2 +- trunk/Documentation/power/runtime_pm.txt | 10 +++++----- trunk/drivers/base/power/runtime.c | 10 ++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 7558c02bedea..77ad56a13074 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fe202fde50a986a8510c62a76dc8733c1a8fac86 +refs/heads/master: 02b26774afebb2d62695ba3230319d70d8c6cc2d diff --git a/trunk/Documentation/power/runtime_pm.txt b/trunk/Documentation/power/runtime_pm.txt index 14dd3c6ad97e..4ce5450ab6e8 100644 --- a/trunk/Documentation/power/runtime_pm.txt +++ b/trunk/Documentation/power/runtime_pm.txt @@ -54,11 +54,10 @@ referred to as subsystem-level callbacks in what follows. By default, the callbacks are always invoked in process context with interrupts enabled. However, subsystems can use the pm_runtime_irq_safe() helper function to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume() -callbacks should be invoked in atomic context with interrupts disabled -(->runtime_idle() is still invoked the default way). This implies that these -callback routines must not block or sleep, but it also means that the -synchronous helper functions listed at the end of Section 4 can be used within -an interrupt handler or in an atomic context. +callbacks should be invoked in atomic context with interrupts disabled. +This implies that these callback routines must not block or sleep, but it also +means that the synchronous helper functions listed at the end of Section 4 can +be used within an interrupt handler or in an atomic context. The subsystem-level suspend callback is _entirely_ _responsible_ for handling the suspend of the device as appropriate, which may, but need not include @@ -483,6 +482,7 @@ pm_runtime_suspend() pm_runtime_autosuspend() pm_runtime_resume() pm_runtime_get_sync() +pm_runtime_put_sync() pm_runtime_put_sync_suspend() 5. Runtime PM Initialization, Device Probing and Removal diff --git a/trunk/drivers/base/power/runtime.c b/trunk/drivers/base/power/runtime.c index 8dc247c974af..acb3f83b8079 100644 --- a/trunk/drivers/base/power/runtime.c +++ b/trunk/drivers/base/power/runtime.c @@ -226,11 +226,17 @@ static int rpm_idle(struct device *dev, int rpmflags) callback = NULL; if (callback) { - spin_unlock_irq(&dev->power.lock); + if (dev->power.irq_safe) + spin_unlock(&dev->power.lock); + else + spin_unlock_irq(&dev->power.lock); callback(dev); - spin_lock_irq(&dev->power.lock); + if (dev->power.irq_safe) + spin_lock(&dev->power.lock); + else + spin_lock_irq(&dev->power.lock); } dev->power.idle_notification = false;