[PATCH] ACPICA: Invoke table unload handler after removing namespace objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>

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 <rafael.j.wysocki@xxxxxxxxx>
---
 drivers/acpi/acpica/tbxfload.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Index: linux-pm/drivers/acpi/acpica/tbxfload.c
===================================================================
--- linux-pm.orig/drivers/acpi/acpica/tbxfload.c
+++ linux-pm/drivers/acpi/acpica/tbxfload.c
@@ -352,15 +352,6 @@ acpi_status acpi_unload_parent_table(acp
 			break;
 		}
 
-		/* 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(acp
 			break;
 		}
 
+		/* 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;

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux