[PATCH v2 0/5] PM: runtime: Improve autosuspend child to parent propagation

From: Brian Norris

Date: Tue Nov 03 2026 - 17:23:28 EST


v1:
https://lore.kernel.org/all/20261002230714.507921-1-briannorris@xxxxxxxxxxxx/
[PATCH 0/5] PM: runtime: Improve autosuspend child to parent propagation

See patch 3 for the primary change here.

In short: today, children can resume/suspend without extending the
autosuspend expiration of their parent. For parents where their activity
is largely driven by their children, this makes it easy to experience
"premature" suspend.

Many .runtime_idle() implementations seem to try to work around this
problem, and one in particular (stm32-adc) documented their problems
heavily in c537d3457542 ("iio: adc: stm32-adc: fix runtime autosuspend
delay when slow polling").

This is an attempt to improve the PM core, as suggested in review for that
change:
https://lore.kernel.org/all/CAPDyKFp=KTf8=zGBSzPYqhjnZpY8xwvjCeM1e-WTKT1QLSxaDA@xxxxxxxxxxxxxx/

This will make it easier to simplify many other drivers too, as a
significant use of .runtime_idle() is to simply extend a parent's
last_busy timestamp, as a proxy for "last activity performed by a
child".

The changes:

1) Preparatory fix, noticed while making the following changes

2) Because the last_busy mathematics get a little more complex, I have
to change last_busy to use an atomic64_t type

3) Propagate last_busy from dependent devices (children, consumers) to
their dependencies (parent, suppliers)

4) Add KUnit tests

5) Remove the pm_runtime_mark_last_busy() workaround from the stm32-adc
driver

To follow on with #5: I believe almost every other .runtime_idle()
implementation in the tree can be removed after patch 3. (There are a
handful of drivers that should just use autosuspend. And perhaps 2 or 3
other drivers that do other non-trivial work with .runtime_idle(). But
most are redundant.) I may work on that next, if this works out.

- Brian

Changes in v2:
* Update comments to explain when/why rpm_propagate_last_busy()
performs the update
* Minor kunit test improvements

Brian Norris (5):
PM: runtime: Only queue an idle check for RPM-linked suppliers (part
2)
PM: runtime: Convert last_busy to atomic64_t
PM: runtime: Propagate last_busy from dependent to dependency
PM: runtime: Add tests for last_busy propagation
iio: adc: stm32-adc: Drop runtime_idle()

drivers/base/power/runtime-test.c | 99 +++++++++++++++++++++++++++++++
drivers/base/power/runtime.c | 30 +++++++++-
drivers/iio/adc/stm32-adc-core.c | 9 +--
include/linux/pm.h | 3 +-
include/linux/pm_runtime.h | 3 +-
5 files changed, 132 insertions(+), 12 deletions(-)

--
2.56.0.398.g882cbad275-goog