[PATCH 0/5] PM: runtime: Improve autosuspend child to parent propagation
From: Brian Norris
Date: Fri Oct 02 2026 - 19:07:36 EST
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
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 | 101 ++++++++++++++++++++++++++++++
drivers/base/power/runtime.c | 29 ++++++++-
drivers/iio/adc/stm32-adc-core.c | 9 +--
include/linux/pm.h | 3 +-
include/linux/pm_runtime.h | 2 +-
5 files changed, 132 insertions(+), 12 deletions(-)
--
2.56.0.rc1.315.gc6ed9934b7-goog