]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PM: runtime: Mark last busy stamp in pm_request_autosuspend()
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 16 Jun 2025 06:12:11 +0000 (09:12 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 18 Jun 2025 19:41:08 +0000 (21:41 +0200)
Set device's last busy timestamp to current time in
pm_request_autosuspend().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patch.msgid.link/20250616061212.2286741-6-sakari.ailus@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Documentation/power/runtime_pm.rst
include/linux/pm_runtime.h

index 39a0b62f6648bc1a58fce11c4dbc17f12b7e09f7..91bc934222627dbfebbed5262e7dba58e259e61b 100644 (file)
@@ -354,9 +354,9 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
       success or error code if the request has not been queued up
 
   `int pm_request_autosuspend(struct device *dev);`
-    - schedule the execution of the subsystem-level suspend callback for the
-      device when the autosuspend delay has expired; if the delay has already
-      expired then the work item is queued up immediately
+    - Call pm_runtime_mark_last_busy() and schedule the execution of the
+      subsystem-level suspend callback for the device when the autosuspend delay
+      expires
 
   `int pm_schedule_suspend(struct device *dev, unsigned int delay);`
     - schedule the execution of the subsystem-level suspend callback for the
index 566a07b60f6399fa4c82693306f892857b016024..778d5988f35e35f83c831f8d6856c62b71fb225e 100644 (file)
@@ -448,11 +448,12 @@ static inline int pm_request_resume(struct device *dev)
 }
 
 /**
- * pm_request_autosuspend - Queue up autosuspend of a device.
+ * pm_request_autosuspend - Update the last access time and queue up autosuspend
+ * of a device.
  * @dev: Target device.
  *
- * Queue up a work item to run an equivalent pm_runtime_autosuspend() for @dev
- * asynchronously.
+ * Update the last access time of a device and queue up a work item to run an
+ * equivalent pm_runtime_autosuspend() for @dev asynchronously.
  *
  * Return:
  * * 0: Success.
@@ -467,6 +468,7 @@ static inline int pm_request_resume(struct device *dev)
  */
 static inline int pm_request_autosuspend(struct device *dev)
 {
+       pm_runtime_mark_last_busy(dev);
        return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO);
 }