ACPICA: Invoke table unload handler after removing namespace objects
Subsystems (2)
PATCH 1/1 ACPICA: Invoke table unload handler after removing namespace objects
From: Rafael J. Wysocki <[email protected]>
At the point where acpi_gbl_table_handler(ACPI_TABLE_EVENT_UNLOAD, ...) is called we don't really know what objects are going to be deleted as a result of the table unload, so it is difficult to do the cleanup from the handler in some cases (specifically, when some data items have been attached to the objects being deleted).
For this reason, call acpi_gbl_table_handler(ACPI_TABLE_EVENT_UNLOAD, ...) after acpi_tb_delete_namespace_by_owner() has run so that it can do the cleanup properly.
Signed-off-by Rafael J. Wysocki <[email protected]>
--- drivers/acpi/acpica/tbxfload.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/acpi/acpica/tbxfload.c +9 -9
@@ -352,15 +352,6 @@ acpi_status acpi_unload_parent_table(acpbreak ; } -/* Invoke table handler if present */ - -if (acpi_gbl_table_handler) { - (void )acpi_gbl_table_handler (ACPI_TABLE_EVENT_UNLOAD , - acpi_gbl_root_table_list. - tables[i].pointer, - acpi_gbl_table_handler_context); - } -/* * Delete all namespace objects owned by this table. Note that * these objects can appear anywhere in the namespace by virtue
@@ -372,6 +363,15 @@ acpi_status acpi_unload_parent_table(acpbreak ; } +/* Invoke table handler if present */ + +if (acpi_gbl_table_handler) { + (void )acpi_gbl_table_handler (ACPI_TABLE_EVENT_UNLOAD , + acpi_gbl_root_table_list. + tables[i].pointer, + acpi_gbl_table_handler_context); + } + status =acpi_tb_release_owner_id (i);acpi_tb_set_table_loaded_flag (i, FALSE);break ;