From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-pm@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@kernel.org>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Subject: [PATCH 6/7] pm: runtime: Mark last busy stamp in pm_request_autosuspend()
Date: Thu, 10 Apr 2025 18:31:05 +0300 [thread overview]
Message-ID: <20250410153106.4146265-7-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20250410153106.4146265-1-sakari.ailus@linux.intel.com>
Set device's last busy timestamp to current time in
pm_request_autosuspend().
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Documentation/power/runtime_pm.rst | 6 +++---
include/linux/pm_runtime.h | 8 +++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/Documentation/power/runtime_pm.rst b/Documentation/power/runtime_pm.rst
index 39a0b62f6648..91bc93422262 100644
--- a/Documentation/power/runtime_pm.rst
+++ b/Documentation/power/runtime_pm.rst
@@ -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
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 3d12cfb0bf00..61ca98cd0aa2 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -444,11 +444,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.
@@ -463,6 +464,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);
}
--
2.39.5
next prev parent reply other threads:[~2025-04-10 15:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 15:30 [PATCH 0/7] Update last busy timestamp in Runtime PM autosuspend callbacks Sakari Ailus
2025-04-10 15:31 ` [PATCH 1/7] Documentation: pm: runtime: Fix a reference to pm_runtime_autosuspend() Sakari Ailus
2025-04-10 20:13 ` Laurent Pinchart
2025-04-15 17:27 ` Rafael J. Wysocki
2025-04-10 15:31 ` [PATCH 2/7] pm: runtime: Document return values of suspend related API functions Sakari Ailus
2025-04-10 15:31 ` [PATCH 3/7] pm: runtime: Mark last busy stamp in pm_runtime_put_autosuspend() Sakari Ailus
2025-04-10 20:17 ` Laurent Pinchart
2025-04-11 6:27 ` Sakari Ailus
2025-04-11 6:33 ` Sakari Ailus
2025-04-10 15:31 ` [PATCH 4/7] pm: runtime: Mark last busy stamp in pm_runtime_put_sync_autosuspend() Sakari Ailus
2025-04-10 20:23 ` Laurent Pinchart
2025-06-16 5:51 ` Sakari Ailus
2025-04-10 15:31 ` [PATCH 5/7] pm: runtime: Mark last busy stamp in pm_runtime_autosuspend() Sakari Ailus
2025-04-10 20:27 ` Laurent Pinchart
2025-04-10 15:31 ` Sakari Ailus [this message]
2025-04-10 20:28 ` [PATCH 6/7] pm: runtime: Mark last busy stamp in pm_request_autosuspend() Laurent Pinchart
2025-04-10 15:31 ` [PATCH 7/7] Documentation: PM: *_autosuspend() functions update last busy time Sakari Ailus
2025-04-10 20:29 ` Laurent Pinchart
2025-04-29 11:10 ` [PATCH 0/7] Update last busy timestamp in Runtime PM autosuspend callbacks Rafael J. Wysocki
2025-06-16 5:42 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250410153106.4146265-7-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.