From: Rafael J. Wysocki Date: Thu, 21 May 2026 14:06:48 +0000 (+0200) Subject: ACPI: PAD: Fix teardown ordering in acpi_pad_remove() X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=5776575d9a7e50e77c45e0ab0271c000496f341d;p=thirdparty%2Fkernel%2Flinux.git ACPI: PAD: Fix teardown ordering in acpi_pad_remove() 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 Link: https://patch.msgid.link/2064153.usQuhbGJ8B@rafael.j.wysocki --- diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index b0a6723fb8549..48c00ee61ed22 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -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[] = {