From ddb34b9d1fa9584d42abd0111dcf9dd94997b49c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: May 25 2023 06:19:22 +0000 Subject: ACPI: EC: Fix oops when removing custom query handlers (git-fixes). --- diff --git a/patches.suse/ACPI-EC-Fix-oops-when-removing-custom-query-handlers.patch b/patches.suse/ACPI-EC-Fix-oops-when-removing-custom-query-handlers.patch new file mode 100644 index 0000000..e826862 --- /dev/null +++ b/patches.suse/ACPI-EC-Fix-oops-when-removing-custom-query-handlers.patch @@ -0,0 +1,40 @@ +From e5b492c6bb900fcf9722e05f4a10924410e170c1 Mon Sep 17 00:00:00 2001 +From: Armin Wolf +Date: Fri, 24 Mar 2023 21:26:27 +0100 +Subject: [PATCH] ACPI: EC: Fix oops when removing custom query handlers +Git-commit: e5b492c6bb900fcf9722e05f4a10924410e170c1 +Patch-mainline: v6.4-rc1 +References: git-fixes + +When removing custom query handlers, the handler might still +be used inside the EC query workqueue, causing a kernel oops +if the module holding the callback function was already unloaded. + +Fix this by flushing the EC query workqueue when removing +custom query handlers. + +Tested on a Acer Travelmate 4002WLMi + +Signed-off-by: Armin Wolf +Signed-off-by: Rafael J. Wysocki +Acked-by: Takashi Iwai + +--- + drivers/acpi/ec.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c +index 5ef72287d1be..928899ab9502 100644 +--- a/drivers/acpi/ec.c ++++ b/drivers/acpi/ec.c +@@ -1133,6 +1133,7 @@ static void acpi_ec_remove_query_handlers(struct acpi_ec *ec, + void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit) + { + acpi_ec_remove_query_handlers(ec, false, query_bit); ++ flush_workqueue(ec_query_wq); + } + EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler); + +-- +2.35.3 + diff --git a/series.conf b/series.conf index e4faee0..e997156 100644 --- a/series.conf +++ b/series.conf @@ -19876,6 +19876,7 @@ patches.suse/ACPICA-ACPICA-check-null-return-of-ACPI_ALLOCATE_ZER.patch patches.suse/ACPI-processor-Fix-evaluating-_PDC-method-when-runni.patch patches.suse/ACPI-VIOT-Initialize-the-correct-IOMMU-fwspec.patch + patches.suse/ACPI-EC-Fix-oops-when-removing-custom-query-handlers.patch patches.suse/ACPI-bus-Ensure-that-notify-handlers-are-not-running.patch patches.suse/crypto-safexcel-Cleanup-ring-IRQ-workqueues-on-load-.patch patches.suse/crypto-caam-Clear-some-memory-in-instantiate_rng.patch