linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Update last busy timestamp in Runtime PM autosuspend callbacks
@ 2025-06-16  6:12 Sakari Ailus
  2025-06-16  6:12 ` [PATCH v2 1/6] pm: runtime: Document return values of suspend related API functions Sakari Ailus
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Sakari Ailus @ 2025-06-16  6:12 UTC (permalink / raw)
  To: linux-pm; +Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Laurent Pinchart

Folks,

The original plan for adding pm_runtime_mark_last_busy() calls to
functions dealing with Runtime PM autosuspend originally included a few
intermediate steps of driver conversion, including the use of recently
added __pm_runtime_put_autosuspend(). The review of the set converting the
users first to __pm_runtime_put_autosuspend() concluded this wasn't
necessary. See
<URL:https://lore.kernel.org/all/20241004094101.113349-1-sakari.ailus@linux.intel.com/>.

This set extends the inclusion of the pm_runtime_mark_last_busy() call to
the _autosuspend() variants of the Runtime PM functions dealing with
suspending devices, i.e. pm_runtime_put_autosuspend(),
pm_runtime_put_sync_autosuspend(), pm_runtime_autosuspend() and
pm_request_autosuspend(). This will introduce, for a brief amount of time,
unnecessary calls to pm_runtime_mark_last_busy() but this wasn't seen as
an issue. Also, all users of these functions, including those that did not
call pm_runtime_mark_last_busy(), will now include that call. Presumably
in the vast majority of the cases a missing call would have been a bug.

Once this set is merged, I'll post further patches to remove the extra
pm_runtime_mark_last_busy() calls. The current set of these patches is
here
<URL:https://git.kernel.org/pub/scm/linux/kernel/git/sailus/linux-next.git/log/?h=pm-direct-on-next>.

It'd be best to have all merged within the same cycle.

Rafael: any thoughts on the merging? Would an immutable branch on top of
rc1 be an option? The patches apply cleanly on v6.16-rc1, v6.16-rc2 and
linux-next.

The changes in the patches to remove the pm_runtime_mark_last_busy() calls
have been generated using the following Coccinelle spatch:

@@
expression E;
identifier label, rval;
@@
- pm_runtime_mark_last_busy(E);
...
(
  label:
|
)
...
(
  pm_runtime_put_autosuspend(E);
|
  pm_runtime_put_sync_autosuspend(E);
|
  pm_runtime_autosuspend(E);
|
  pm_request_autosuspend(E);
|
  (void)pm_runtime_put_autosuspend(E);
|
  (void)pm_runtime_put_sync_autosuspend(E);
|
  (void)pm_runtime_autosuspend(E);
|
  (void)pm_request_autosuspend(E);
|
  return pm_runtime_put_autosuspend(E);
|
  return pm_runtime_put_sync_autosuspend(E);
|
  return pm_runtime_autosuspend(E);
|
  return pm_request_autosuspend(E);
|
  rval = pm_runtime_put_autosuspend(E);
|
  rval = pm_runtime_put_sync_autosuspend(E);
|
  rval = pm_runtime_autosuspend(E);
|
  rval = pm_request_autosuspend(E);
)

since v1:

- kernel-doc fix in patch "pm: runtime: Mark last busy stamp in
  pm_runtime_put_sync_autosuspend()".

- Dropped the first patch which has been merged already.

Sakari Ailus (6):
  pm: runtime: Document return values of suspend related API functions
  pm: runtime: Mark last busy stamp in pm_runtime_put_autosuspend()
  pm: runtime: Mark last busy stamp in pm_runtime_put_sync_autosuspend()
  pm: runtime: Mark last busy stamp in pm_runtime_autosuspend()
  pm: runtime: Mark last busy stamp in pm_request_autosuspend()
  Documentation: PM: *_autosuspend() functions update last busy time

 Documentation/power/runtime_pm.rst |  50 ++++----
 include/linux/pm_runtime.h         | 187 +++++++++++++++++++++++++----
 2 files changed, 186 insertions(+), 51 deletions(-)

-- 
2.39.5


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-08-29 10:23 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-16  6:12 [PATCH v2 0/6] Update last busy timestamp in Runtime PM autosuspend callbacks Sakari Ailus
2025-06-16  6:12 ` [PATCH v2 1/6] pm: runtime: Document return values of suspend related API functions Sakari Ailus
2025-08-14 22:56   ` Brian Norris
2025-08-29  0:46     ` Brian Norris
2025-08-29 10:23       ` Sakari Ailus
2025-06-16  6:12 ` [PATCH v2 2/6] pm: runtime: Mark last busy stamp in pm_runtime_put_autosuspend() Sakari Ailus
2025-06-16  6:12 ` [PATCH v2 3/6] pm: runtime: Mark last busy stamp in pm_runtime_put_sync_autosuspend() Sakari Ailus
2025-06-16  6:12 ` [PATCH v2 4/6] pm: runtime: Mark last busy stamp in pm_runtime_autosuspend() Sakari Ailus
2025-06-16  6:12 ` [PATCH v2 5/6] pm: runtime: Mark last busy stamp in pm_request_autosuspend() Sakari Ailus
2025-06-16  6:12 ` [PATCH v2 6/6] Documentation: PM: *_autosuspend() functions update last busy time Sakari Ailus
2025-06-16 11:21 ` [PATCH v2 0/6] Update last busy timestamp in Runtime PM autosuspend callbacks Rafael J. Wysocki
2025-06-16 19:20   ` Sakari Ailus
2025-06-16 20:10     ` Laurent Pinchart
2025-06-18 19:43     ` Rafael J. Wysocki
2025-06-25  9:15       ` Sakari Ailus
2025-06-23 13:28 ` Oliver Neukum
2025-06-25  6:59   ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).