aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2015-07-01 02:44:31 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-07-01 17:17:54 -0400
commit8ea98655775e904ea406d74a887d0b2254651b5a (patch)
tree06414a7a2a98370bbec306ceb7083484cdeaf88d
parentfe536995f2fe26fff111a9a06bf3f71e179c92cf (diff)
ACPICA: Namespace: Change namespace override to avoid node deletion
ACPICA commit c0ce529e1fbb8ec47d2522a3aa10f3ab77e16e41 There is no reference counting implemented for struct acpi_namespace_node, so it is currently not removable during runtime. This patch changes the namespace override code to keep the old struct acpi_namespace_node undeleted so that the override mechanism can happen during runtime. Bob Moore. Link: https://github.com/acpica/acpica/commit/c0ce529e Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/nssearch.c23
-rw-r--r--include/acpi/acpixf.h5
2 files changed, 24 insertions, 4 deletions
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c
index 47fbe5b33524..d73904013830 100644
--- a/drivers/acpi/acpica/nssearch.c
+++ b/drivers/acpi/acpica/nssearch.c
@@ -331,13 +331,28 @@ acpi_ns_search_and_enter(u32 target_name,
331 331
332 /* 332 /*
333 * If the namespace override feature is enabled for this node, 333 * If the namespace override feature is enabled for this node,
334 * delete any existing node. This can only happen during the 334 * delete any existing attached sub-object and make the node
335 * boot stage, thus it is safe to remove the node here. 335 * look like a new node that is owned by the override table.
336 */ 336 */
337 if (flags & ACPI_NS_OVERRIDE_IF_FOUND) { 337 if (flags & ACPI_NS_OVERRIDE_IF_FOUND) {
338 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
339 "Namespace override: %4.4s pass %u type %X Owner %X\n",
340 ACPI_CAST_PTR(char,
341 &target_name),
342 interpreter_mode,
343 (*return_node)->type,
344 walk_state->owner_id));
345
338 acpi_ns_delete_children(*return_node); 346 acpi_ns_delete_children(*return_node);
339 acpi_ns_remove_node(*return_node); 347 if (acpi_gbl_runtime_namespace_override) {
340 *return_node = ACPI_ENTRY_NOT_FOUND; 348 acpi_ut_remove_reference((*return_node)->object);
349 (*return_node)->object = NULL;
350 (*return_node)->owner_id =
351 walk_state->owner_id;
352 } else {
353 acpi_ns_remove_node(*return_node);
354 *return_node = ACPI_ENTRY_NOT_FOUND;
355 }
341 } 356 }
342 357
343 /* Return an error if we don't expect to find the object */ 358 /* Return an error if we don't expect to find the object */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 213ed7ecfd8d..f6d807170346 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -229,6 +229,11 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE);
229ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE); 229ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE);
230 230
231/* 231/*
232 * Optionally enable runtime namespace override.
233 */
234ACPI_INIT_GLOBAL(u8, acpi_gbl_runtime_namespace_override, TRUE);
235
236/*
232 * We keep track of the latest version of Windows that has been requested by 237 * We keep track of the latest version of Windows that has been requested by
233 * the BIOS. ACPI 5.0. 238 * the BIOS. ACPI 5.0.
234 */ 239 */