Skip to content

Commit 18c1fe5

Browse files
Sakari Ailusrafaeljw
authored andcommitted
PM: runtime: Mark last busy stamp in pm_request_autosuspend()
Set device's last busy timestamp to current time in pm_request_autosuspend(). Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 08071e6 commit 18c1fe5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Documentation/power/runtime_pm.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,9 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
354354
success or error code if the request has not been queued up
355355

356356
`int pm_request_autosuspend(struct device *dev);`
357-
- schedule the execution of the subsystem-level suspend callback for the
358-
device when the autosuspend delay has expired; if the delay has already
359-
expired then the work item is queued up immediately
357+
- Call pm_runtime_mark_last_busy() and schedule the execution of the
358+
subsystem-level suspend callback for the device when the autosuspend delay
359+
expires
360360

361361
`int pm_schedule_suspend(struct device *dev, unsigned int delay);`
362362
- schedule the execution of the subsystem-level suspend callback for the

include/linux/pm_runtime.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,12 @@ static inline int pm_request_resume(struct device *dev)
448448
}
449449

450450
/**
451-
* pm_request_autosuspend - Queue up autosuspend of a device.
451+
* pm_request_autosuspend - Update the last access time and queue up autosuspend
452+
* of a device.
452453
* @dev: Target device.
453454
*
454-
* Queue up a work item to run an equivalent pm_runtime_autosuspend() for @dev
455-
* asynchronously.
455+
* Update the last access time of a device and queue up a work item to run an
456+
* equivalent pm_runtime_autosuspend() for @dev asynchronously.
456457
*
457458
* Return:
458459
* * 0: Success.
@@ -467,6 +468,7 @@ static inline int pm_request_resume(struct device *dev)
467468
*/
468469
static inline int pm_request_autosuspend(struct device *dev)
469470
{
471+
pm_runtime_mark_last_busy(dev);
470472
return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO);
471473
}
472474

0 commit comments

Comments
 (0)