Skip to content

Commit ce195d3

Browse files
committed
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: PM / Runtime: Allow _put_sync() from interrupts-disabled context PM / Domains: Fix pm_genpd_poweron()
2 parents 2560540 + 02b2677 commit ce195d3

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

Documentation/power/runtime_pm.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ referred to as subsystem-level callbacks in what follows.
5454
By default, the callbacks are always invoked in process context with interrupts
5555
enabled. However, subsystems can use the pm_runtime_irq_safe() helper function
5656
to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume()
57-
callbacks should be invoked in atomic context with interrupts disabled
58-
(->runtime_idle() is still invoked the default way). This implies that these
59-
callback routines must not block or sleep, but it also means that the
60-
synchronous helper functions listed at the end of Section 4 can be used within
61-
an interrupt handler or in an atomic context.
57+
callbacks should be invoked in atomic context with interrupts disabled.
58+
This implies that these callback routines must not block or sleep, but it also
59+
means that the synchronous helper functions listed at the end of Section 4 can
60+
be used within an interrupt handler or in an atomic context.
6261

6362
The subsystem-level suspend callback is _entirely_ _responsible_ for handling
6463
the suspend of the device as appropriate, which may, but need not include
@@ -483,6 +482,7 @@ pm_runtime_suspend()
483482
pm_runtime_autosuspend()
484483
pm_runtime_resume()
485484
pm_runtime_get_sync()
485+
pm_runtime_put_sync()
486486
pm_runtime_put_sync_suspend()
487487

488488
5. Runtime PM Initialization, Device Probing and Removal

drivers/base/power/domain.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ static void genpd_set_active(struct generic_pm_domain *genpd)
8080
int pm_genpd_poweron(struct generic_pm_domain *genpd)
8181
{
8282
struct generic_pm_domain *parent = genpd->parent;
83-
DEFINE_WAIT(wait);
8483
int ret = 0;
8584

8685
start:
@@ -112,7 +111,7 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd)
112111
}
113112

114113
if (genpd->power_on) {
115-
int ret = genpd->power_on(genpd);
114+
ret = genpd->power_on(genpd);
116115
if (ret)
117116
goto out;
118117
}

drivers/base/power/runtime.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,17 @@ static int rpm_idle(struct device *dev, int rpmflags)
226226
callback = NULL;
227227

228228
if (callback) {
229-
spin_unlock_irq(&dev->power.lock);
229+
if (dev->power.irq_safe)
230+
spin_unlock(&dev->power.lock);
231+
else
232+
spin_unlock_irq(&dev->power.lock);
230233

231234
callback(dev);
232235

233-
spin_lock_irq(&dev->power.lock);
236+
if (dev->power.irq_safe)
237+
spin_lock(&dev->power.lock);
238+
else
239+
spin_lock_irq(&dev->power.lock);
234240
}
235241

236242
dev->power.idle_notification = false;

0 commit comments

Comments
 (0)