[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240430142434.10471-10-Jonathan.Cameron@huawei.com>
Date: Tue, 30 Apr 2024 15:24:24 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Thomas Gleixner <tglx@...utronix.de>, Peter Zijlstra
<peterz@...radead.org>, <linux-pm@...r.kernel.org>,
<loongarch@...ts.linux.dev>, <linux-acpi@...r.kernel.org>,
<linux-arch@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <kvmarm@...ts.linux.dev>,
<x86@...nel.org>, Russell King <linux@...linux.org.uk>, "Rafael J . Wysocki"
<rafael@...nel.org>, Miguel Luis <miguel.luis@...cle.com>, James Morse
<james.morse@....com>, Salil Mehta <salil.mehta@...wei.com>, Jean-Philippe
Brucker <jean-philippe@...aro.org>, Catalin Marinas
<catalin.marinas@....com>, Will Deacon <will@...nel.org>, Marc Zyngier
<maz@...nel.org>, Hanjun Guo <guohanjun@...wei.com>, Gavin Shan
<gshan@...hat.com>
CC: Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, Dave
Hansen <dave.hansen@...ux.intel.com>, <linuxarm@...wei.com>,
<justin.he@....com>, <jianyong.wu@....com>
Subject: [PATCH v9 09/19] ACPI: scan: switch to flags for acpi_scan_check_and_detach()
Precursor patch adds the ability to pass a uintptr_t of flags into
acpi_scan_check_and detach() so that additional flags can be
added to indicate whether to defer portions of the eject flow.
The new flag follows in the next patch.
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Reviewed-by: Hanjun Guo <guohanjun@...wei.com>
Reviewed-by: Gavin Shan <gshan@...hat.com>
Tested-by: Miguel Luis <miguel.luis@...cle.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
---
v9: No change
---
drivers/acpi/scan.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 7c157bf92695..fb5427caf0f4 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -244,13 +244,16 @@ static int acpi_scan_try_to_offline(struct acpi_device *device)
return 0;
}
-static int acpi_scan_check_and_detach(struct acpi_device *adev, void *check)
+#define ACPI_SCAN_CHECK_FLAG_STATUS BIT(0)
+
+static int acpi_scan_check_and_detach(struct acpi_device *adev, void *p)
{
struct acpi_scan_handler *handler = adev->handler;
+ uintptr_t flags = (uintptr_t)p;
- acpi_dev_for_each_child_reverse(adev, acpi_scan_check_and_detach, check);
+ acpi_dev_for_each_child_reverse(adev, acpi_scan_check_and_detach, p);
- if (check) {
+ if (flags & ACPI_SCAN_CHECK_FLAG_STATUS) {
acpi_bus_get_status(adev);
/*
* Skip devices that are still there and take the enabled
@@ -288,7 +291,9 @@ static int acpi_scan_check_and_detach(struct acpi_device *adev, void *check)
static void acpi_scan_check_subtree(struct acpi_device *adev)
{
- acpi_scan_check_and_detach(adev, (void *)true);
+ uintptr_t flags = ACPI_SCAN_CHECK_FLAG_STATUS;
+
+ acpi_scan_check_and_detach(adev, (void *)flags);
}
static int acpi_scan_hot_remove(struct acpi_device *device)
@@ -2600,7 +2605,9 @@ EXPORT_SYMBOL(acpi_bus_scan);
*/
void acpi_bus_trim(struct acpi_device *adev)
{
- acpi_scan_check_and_detach(adev, NULL);
+ uintptr_t flags = 0;
+
+ acpi_scan_check_and_detach(adev, (void *)flags);
}
EXPORT_SYMBOL_GPL(acpi_bus_trim);
--
2.39.2
Powered by blists - more mailing lists