From: Brian Norris <briannorris@chromium.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-iio@vger.kernel.org,
"Andy Shevchenko" <andy@kernel.org>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Nuno Sá" <nuno.sa@analog.com>,
linux-stm32@st-md-mailman.stormreply.com,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
linux-kernel@vger.kernel.org,
"Fabrice Gasnier" <fabrice.gasnier@st.com>,
linux-arm-kernel@lists.infradead.org,
"Brian Norris" <briannorris@chromium.org>
Subject: [PATCH 0/5] PM: runtime: Improve autosuspend child to parent propagation
Date: Fri, 2 Oct 2026 16:03:04 -0700 [thread overview]
Message-ID: <20261002230714.507921-1-briannorris@chromium.org> (raw)
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@mail.gmail.com/
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
next reply other threads:[~2026-10-02 23:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 23:03 Brian Norris [this message]
2026-10-02 23:03 ` [PATCH 1/5] PM: runtime: Only queue an idle check for RPM-linked suppliers (part 2) Brian Norris
2026-10-02 23:03 ` [PATCH 2/5] PM: runtime: Convert last_busy to atomic64_t Brian Norris
2026-10-02 23:03 ` [PATCH 3/5] PM: runtime: Propagate last_busy from dependent to dependency Brian Norris
2026-10-03 15:21 ` Andy Shevchenko
2026-10-05 18:05 ` Brian Norris
2026-10-02 23:03 ` [PATCH 4/5] PM: runtime: Add tests for last_busy propagation Brian Norris
2026-10-02 23:03 ` [PATCH 5/5] iio: adc: stm32-adc: Drop runtime_idle() Brian Norris
2026-10-06 12:42 ` Fabrice Gasnier
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=20261002230714.507921-1-briannorris@chromium.org \
--to=briannorris@chromium.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=fabrice.gasnier@st.com \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=nuno.sa@analog.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox