Skip to content

Commit bdfacf4

Browse files
committed
Merge back earlier runtime PM changes for 6.19
2 parents 58ca21d + 4e48e7b commit bdfacf4

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

Documentation/power/runtime_pm.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,6 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
480480
`bool pm_runtime_status_suspended(struct device *dev);`
481481
- return true if the device's runtime PM status is 'suspended'
482482

483-
`void pm_runtime_allow(struct device *dev);`
484-
- set the power.runtime_auto flag for the device and decrease its usage
485-
counter (used by the /sys/devices/.../power/control interface to
486-
effectively allow the device to be power managed at run time)
487-
488-
`void pm_runtime_forbid(struct device *dev);`
489-
- unset the power.runtime_auto flag for the device and increase its usage
490-
counter (used by the /sys/devices/.../power/control interface to
491-
effectively prevent the device from being power managed at run time)
492-
493483
`void pm_runtime_no_callbacks(struct device *dev);`
494484
- set the power.no_callbacks flag for the device and remove the runtime
495485
PM attributes from /sys/devices/.../power (or prevent them from being

drivers/base/power/runtime.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void update_pm_runtime_accounting(struct device *dev)
9090
/*
9191
* Because ktime_get_mono_fast_ns() is not monotonic during
9292
* timekeeping updates, ensure that 'now' is after the last saved
93-
* timesptamp.
93+
* timestamp.
9494
*/
9595
if (now < last)
9696
return;
@@ -217,7 +217,7 @@ static int dev_memalloc_noio(struct device *dev, void *data)
217217
* resume/suspend callback of any one of its ancestors(or the
218218
* block device itself), the deadlock may be triggered inside the
219219
* memory allocation since it might not complete until the block
220-
* device becomes active and the involed page I/O finishes. The
220+
* device becomes active and the involved page I/O finishes. The
221221
* situation is pointed out first by Alan Stern. Network device
222222
* are involved in iSCSI kind of situation.
223223
*
@@ -1210,7 +1210,7 @@ EXPORT_SYMBOL_GPL(__pm_runtime_resume);
12101210
*
12111211
* Otherwise, if its runtime PM status is %RPM_ACTIVE and (1) @ign_usage_count
12121212
* is set, or (2) @dev is not ignoring children and its active child count is
1213-
* nonero, or (3) the runtime PM usage counter of @dev is not zero, increment
1213+
* nonzero, or (3) the runtime PM usage counter of @dev is not zero, increment
12141214
* the usage counter of @dev and return 1.
12151215
*
12161216
* Otherwise, return 0 without changing the usage counter.
@@ -1664,9 +1664,12 @@ EXPORT_SYMBOL_GPL(devm_pm_runtime_get_noresume);
16641664
* pm_runtime_forbid - Block runtime PM of a device.
16651665
* @dev: Device to handle.
16661666
*
1667-
* Increase the device's usage count and clear its power.runtime_auto flag,
1668-
* so that it cannot be suspended at run time until pm_runtime_allow() is called
1669-
* for it.
1667+
* Resume @dev if already suspended and block runtime suspend of @dev in such
1668+
* a way that it can be unblocked via the /sys/devices/.../power/control
1669+
* interface, or otherwise by calling pm_runtime_allow().
1670+
*
1671+
* Calling this function many times in a row has the same effect as calling it
1672+
* once.
16701673
*/
16711674
void pm_runtime_forbid(struct device *dev)
16721675
{
@@ -1687,7 +1690,13 @@ EXPORT_SYMBOL_GPL(pm_runtime_forbid);
16871690
* pm_runtime_allow - Unblock runtime PM of a device.
16881691
* @dev: Device to handle.
16891692
*
1690-
* Decrease the device's usage count and set its power.runtime_auto flag.
1693+
* Unblock runtime suspend of @dev after it has been blocked by
1694+
* pm_runtime_forbid() (for instance, if it has been blocked via the
1695+
* /sys/devices/.../power/control interface), check if @dev can be
1696+
* suspended and suspend it in that case.
1697+
*
1698+
* Calling this function many times in a row has the same effect as calling it
1699+
* once.
16911700
*/
16921701
void pm_runtime_allow(struct device *dev)
16931702
{

0 commit comments

Comments
 (0)