Skip to content

Commit 6146b94

Browse files
committed
Merge branch 'pm-runtime'
Merge a runtime PM documentation update depended on by subsequent changes. * pm-runtime: PM: Rearrange documentation related to __pm_runtime_disable()
2 parents d42044a + 258e231 commit 6146b94

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

drivers/base/power/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,10 @@ static int device_suspend_late(struct device *dev, pm_message_t state, bool asyn
14041404
TRACE_DEVICE(dev);
14051405
TRACE_SUSPEND(0);
14061406

1407+
/*
1408+
* Disable runtime PM for the device without checking if there is a
1409+
* pending resume request for it.
1410+
*/
14071411
__pm_runtime_disable(dev, false);
14081412

14091413
dpm_wait_for_subordinate(dev, async);

drivers/base/power/runtime.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,20 +1460,6 @@ int pm_runtime_barrier(struct device *dev)
14601460
}
14611461
EXPORT_SYMBOL_GPL(pm_runtime_barrier);
14621462

1463-
/**
1464-
* __pm_runtime_disable - Disable runtime PM of a device.
1465-
* @dev: Device to handle.
1466-
* @check_resume: If set, check if there's a resume request for the device.
1467-
*
1468-
* Increment power.disable_depth for the device and if it was zero previously,
1469-
* cancel all pending runtime PM requests for the device and wait for all
1470-
* operations in progress to complete. The device can be either active or
1471-
* suspended after its runtime PM has been disabled.
1472-
*
1473-
* If @check_resume is set and there's a resume request pending when
1474-
* __pm_runtime_disable() is called and power.disable_depth is zero, the
1475-
* function will wake up the device before disabling its runtime PM.
1476-
*/
14771463
void __pm_runtime_disable(struct device *dev, bool check_resume)
14781464
{
14791465
spin_lock_irq(&dev->power.lock);

include/linux/pm_runtime.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -556,11 +556,18 @@ static inline int pm_runtime_set_suspended(struct device *dev)
556556
* pm_runtime_disable - Disable runtime PM for a device.
557557
* @dev: Target device.
558558
*
559-
* Prevent the runtime PM framework from working with @dev (by incrementing its
560-
* "blocking" counter).
561-
*
562-
* For each invocation of this function for @dev there must be a matching
563-
* pm_runtime_enable() call in order for runtime PM to be enabled for it.
559+
* Prevent the runtime PM framework from working with @dev by incrementing its
560+
* "disable" counter.
561+
*
562+
* If the counter is zero when this function runs and there is a pending runtime
563+
* resume request for @dev, it will be resumed. If the counter is still zero at
564+
* that point, all of the pending runtime PM requests for @dev will be canceled
565+
* and all runtime PM operations in progress involving it will be waited for to
566+
* complete.
567+
*
568+
* For each invocation of this function for @dev, there must be a matching
569+
* pm_runtime_enable() call, so that runtime PM is eventually enabled for it
570+
* again.
564571
*/
565572
static inline void pm_runtime_disable(struct device *dev)
566573
{

0 commit comments

Comments
 (0)