From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Alan Stern <stern@rowland.harvard.edu>,
Ulf Hansson <ulf.hansson@linaro.org>,
Johan Hovold <johan@kernel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Jon Hunter <jonathanh@nvidia.com>
Subject: [PATCH v1 00/10] PM: Make the core and pm_runtime_force_suspend/resume() agree more
Date: Tue, 11 Feb 2025 22:01:24 +0100 [thread overview]
Message-ID: <2314745.iZASKD2KPV@rjwysocki.net> (raw)
Hi Everyone,
This series is a result of the discussion on a recently reported issue
with device runtime PM status propagation during system resume and
the resulting patches:
https://lore.kernel.org/linux-pm/12619233.O9o76ZdvQC@rjwysocki.net/
https://lore.kernel.org/linux-pm/6137505.lOV4Wx5bFT@rjwysocki.net/
Overall, due to restrictions related to pm_runtime_force_suspend() and
pm_runtime_force_resume(), it was necessary to limit the RPM_ACTIVE
setting propagation to the parent of the first device in a dependency
chain that turned out to have to be resumed during system resume even
though it was runtime-suspended before system suspend.
Those restrictions are that (1) pm_runtime_force_suspend() attempts to
suspend devices that have never had runtime PM enabled if their runtime
PM status is currently RPM_ACTIVE and (2) pm_runtime_force_resume()
will skip device whose runtime PM status is currently RPM_ACTIVE.
The purpose of this series is to eliminate the above restrictions and
get pm_runtime_force_suspend() and pm_runtime_force_resume() to agree
more with what the core does.
First off, it turns out that detecting devices that have never had
runtime PM enabled is not really hard - it is sufficient to check
their power.last_status data when runtime PM is disabled. If
power.last_status is RPM_INVALID at that point, runtime PM has never
been enabled for the given device, so patch [01/10] adds a helper
function for checking that.
Patch [02/10] makes the PM core use the new function to avoid setting
power.set_active for devices with no runtime PM support which really
is a fixup on top of
https://lore.kernel.org/linux-pm/6137505.lOV4Wx5bFT@rjwysocki.net/
Patch [03/10] modifies pm_runtime_force_suspend() to skip devices
with no runtime PM support with the help of the new function.
Next, patch [04/10] uses the observation that the runtime PM status
check in pm_runtime_force_resume() is redundant and drops that check.
Patch [05/10] removes the wakeirq enabling from the pm_runtime_force_resume()
error path because it is not really a good idea to enable wakeirqs during
system resume.
Patch [06/10] makes the PM core somewhat more consistent with
pm_runtime_force_suspend() and patch [07/10] prepares it for the subsequent
changes.
Patch [08/10] changes pm_runtime_force_resume() to handle the case in
which the runtime PM status of the device has been updated by the core to
RPM_ACTIVE after pm_runtime_force_suspend() left it in RPM_SUSPENDED.
Patch [09/10] restores the RPM_ACTIVE setting propagation to parents
and suppliers, but it takes exceptions into account (for example, devices
with no runtime PM support).
Finally, patch [10/10] adds a mechanism to discover cases in which runtime PM
is disabled for a device permanently even though it has been enabled for that
device at one point.
Please have a look and let me know if you see any problems.
Thanks!
next reply other threads:[~2025-02-11 21:25 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-11 21:01 Rafael J. Wysocki [this message]
2025-02-11 21:02 ` [PATCH v1 01/10] PM: runtime: Introduce pm_runtime_no_support() Rafael J. Wysocki
2025-02-11 21:03 ` [PATCH v1 02/10] PM: sleep: core: Use pm_runtime_no_support() during set_active updates Rafael J. Wysocki
2025-02-11 21:05 ` [PATCH v1 03/10] PM: runtime: Use pm_runtime_no_support() in pm_runtime_force_suspend() Rafael J. Wysocki
2025-02-11 21:07 ` [PATCH v1 04/10] PM: runtime: Drop status check from pm_runtime_force_resume() Rafael J. Wysocki
2025-02-11 21:09 ` [PATCH v1 05/10] PM: runtime: Do not enable wakeup IRQs during system resume Rafael J. Wysocki
2025-02-11 21:10 ` [PATCH v1 06/10] PM: sleep: Adjust check before setting power.must_resume Rafael J. Wysocki
2025-02-11 21:11 ` [PATCH v1 07/10] PM: sleep: Clear the power.set_active upfront Rafael J. Wysocki
2025-02-11 21:19 ` [PATCH v1 08/10] PM: sleep: Make pm_runtime_force_resume() look at power.set_active Rafael J. Wysocki
2025-02-11 21:21 ` [PATCH v1 09/10] PM: sleep: Propagate power.set_active in dependency chains Rafael J. Wysocki
2025-02-11 21:25 ` [PATCH v1 10/10] PM: runtime: Discover the lack of runtime PM support Rafael J. Wysocki
2025-02-12 11:14 ` Rafael J. Wysocki
2025-02-12 9:12 ` [PATCH v1 00/10] PM: Make the core and pm_runtime_force_suspend/resume() agree more Ulf Hansson
2025-02-12 10:59 ` Rafael J. Wysocki
2025-02-12 11:33 ` Rafael J. Wysocki
2025-02-12 11:36 ` Rafael J. Wysocki
2025-02-12 15:14 ` Ulf Hansson
2025-02-12 17:05 ` Rafael J. Wysocki
2025-02-12 19:04 ` Rafael J. Wysocki
2025-02-13 13:37 ` Ulf Hansson
2025-02-13 20:42 ` Rafael J. Wysocki
2025-02-13 13:10 ` Ulf Hansson
2025-02-13 20:17 ` Rafael J. Wysocki
2025-02-14 9:55 ` Ulf Hansson
2025-02-15 12:32 ` Rafael J. Wysocki
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=2314745.iZASKD2KPV@rjwysocki.net \
--to=rjw@rjwysocki.net \
--cc=johan@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=stern@rowland.harvard.edu \
--cc=ulf.hansson@linaro.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