]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPI: PAD: Fix teardown ordering in acpi_pad_remove()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 21 May 2026 14:06:48 +0000 (16:06 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 25 May 2026 14:43:51 +0000 (16:43 +0200)
The ACPI notify handler installed by acpi_pad_probe() needs to be
removed before calling acpi_pad_idle_cpus() in acpi_pad_remove()
so it doesn't schedule idle time injection on some CPUs again.

Fixes: 8e0af5141ab9 ("ACPI: create Processor Aggregator Device driver")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2064153.usQuhbGJ8B@rafael.j.wysocki
drivers/acpi/acpi_pad.c

index b0a6723fb85491eddac150e21018a4495d8680c2..48c00ee61ed224c88d90b4ad51d08630b84bdfe3 100644 (file)
@@ -430,12 +430,12 @@ static int acpi_pad_probe(struct platform_device *pdev)
 
 static void acpi_pad_remove(struct platform_device *pdev)
 {
+       acpi_dev_remove_notify_handler(ACPI_COMPANION(&pdev->dev),
+                                      ACPI_DEVICE_NOTIFY, acpi_pad_notify);
+
        mutex_lock(&isolated_cpus_lock);
        acpi_pad_idle_cpus(0);
        mutex_unlock(&isolated_cpus_lock);
-
-       acpi_dev_remove_notify_handler(ACPI_COMPANION(&pdev->dev),
-                                      ACPI_DEVICE_NOTIFY, acpi_pad_notify);
 }
 
 static const struct acpi_device_id pad_device_ids[] = {