From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: Linux PM <linux-pm@vger.kernel.org>,
Brian Norris <briannorris@chromium.org>
Subject: [PATCH v1] ACPI: TAD: Improve runtime PM handling during driver removal
Date: Thu, 19 Nov 2026 20:58:26 +0100 [thread overview]
Message-ID: <6052490.DvuYhMxLoT@rafael.j.wysocki> (raw)
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
In acpi_tad_remove(), instead of attempting a runtime suspend of the
device which may be blocked by user space via "power/control", change
the device's runtime PM status to "suspended" after disabling runtime
PM for it to potentially unblock the runtime suspend of its parent and
suppliers (if any).
Since pm_runtime_suspend() is not called in acpi_tad_remove() any more,
the latter need not drop the runtime PM reference to the device held by
it, so make it use guard()() instead of scoped_guard() for acquiring
that reference and reduce the indentation level.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/acpi_tad.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
--- a/drivers/acpi/acpi_tad.c
+++ b/drivers/acpi/acpi_tad.c
@@ -850,19 +850,21 @@ static void acpi_tad_remove(void *data)
device_init_wakeup(dev, false);
- scoped_guard(pm_runtime_noresume, dev) {
- if (dd->capabilities & ACPI_TAD_AC_WAKE) {
- acpi_tad_disable_timer(dev, ACPI_TAD_AC_TIMER);
- acpi_tad_clear_status(dev, ACPI_TAD_AC_TIMER);
- }
- if (dd->capabilities & ACPI_TAD_DC_WAKE) {
- acpi_tad_disable_timer(dev, ACPI_TAD_DC_TIMER);
- acpi_tad_clear_status(dev, ACPI_TAD_DC_TIMER);
- }
+ guard(pm_runtime_noresume)(dev);
+
+ if (dd->capabilities & ACPI_TAD_AC_WAKE) {
+ acpi_tad_disable_timer(dev, ACPI_TAD_AC_TIMER);
+ acpi_tad_clear_status(dev, ACPI_TAD_AC_TIMER);
+ }
+ if (dd->capabilities & ACPI_TAD_DC_WAKE) {
+ acpi_tad_disable_timer(dev, ACPI_TAD_DC_TIMER);
+ acpi_tad_clear_status(dev, ACPI_TAD_DC_TIMER);
}
- pm_runtime_suspend(dev);
pm_runtime_disable(dev);
+ /* Allow the parent and suppliers (if any) to suspend. */
+ pm_runtime_set_suspended(dev);
+ /* No need to power down, the PM domain detach will take care of it. */
}
static int acpi_tad_probe(struct platform_device *pdev)
next reply other threads:[~2026-11-19 19:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 19:58 Rafael J. Wysocki [this message]
2026-11-19 21:56 ` [PATCH v1] ACPI: TAD: Improve runtime PM handling during driver removal Brian Norris
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=6052490.DvuYhMxLoT@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=briannorris@chromium.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@vger.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