[PATCH v2 36/42] ACPICA: tables: Fix wrong table unload and notify call order
From: Maciej Wieczor-Retman
Date: Fri Nov 20 2026 - 12:24:34 EST
Newly added cleanup - AcpiEvClearGpeDispatchByOwner() - was ordered in
such a manner that if the clear gpe dispatch call failed it would leave
GPEs still enabled but the host would get notified that the table is
unloaded already.
Simply reorder the code blocks so that notifying the host happens last,
after the GPE dispatch cleanup.
Link: https://github.com/acpica/acpica/commit/b97317a4ef0c
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
---
drivers/acpi/acpica/tbdata.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index c756d34eeb44..1cf0a46b3539 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -1068,13 +1068,6 @@ acpi_status acpi_tb_unload_table(u32 table_index)
return_ACPI_STATUS(AE_NOT_EXIST);
}
- /* Invoke table handler */
-
- status = acpi_get_table_by_index(table_index, &table);
- if (ACPI_SUCCESS(status)) {
- acpi_tb_notify_table(ACPI_TABLE_EVENT_UNLOAD, table);
- }
-
#if (!ACPI_REDUCED_HARDWARE)
/*
* Clear GPE dispatch for methods owned by the table being unloaded.
@@ -1088,6 +1081,13 @@ acpi_status acpi_tb_unload_table(u32 table_index)
}
#endif /* !ACPI_REDUCED_HARDWARE */
+ /* Invoke table handler */
+
+ status = acpi_get_table_by_index(table_index, &table);
+ if (ACPI_SUCCESS(status)) {
+ acpi_tb_notify_table(ACPI_TABLE_EVENT_UNLOAD, table);
+ }
+
/* Delete the portion of the namespace owned by this table */
status = acpi_tb_delete_namespace_by_owner(table_index);
--
2.56.0