From c2b3bf4643dbb78eb201b921c55d8a842d7f4d7b Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <410c2f0190f74c35505beda6ff3f2da7819f8bac.1164352285.git.len.brown@intel.com> References: <410c2f0190f74c35505beda6ff3f2da7819f8bac.1164352285.git.len.brown@intel.com> From: Robert Moore Date: Tue, 14 Nov 2006 20:05:34 +0300 Subject: [PATCH 35/65] ACPICA: Report error if method creates 2 objects with the same name Reply-To: Len Brown Organization: Intel Open Source Technology Center Fixed a regression where an error was no longer emitted if a control method attempts to create 2 objects of the same name. This previously and now returns AE_ALREADY_EXISTS. When this exception occurs, it invokes the mechanism that will dynamically serialize the control method to possible prevent future errors. (BZ 440) Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/dispatcher/dswload.c | 15 ++++++++++++--- drivers/acpi/parser/psparse.c | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c index d60d062..565d455 100644 --- a/drivers/acpi/dispatcher/dswload.c +++ b/drivers/acpi/dispatcher/dswload.c @@ -547,6 +547,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_ acpi_status status; acpi_object_type object_type; char *buffer_ptr; + u32 flags; ACPI_FUNCTION_TRACE(ds_load2_begin_op); @@ -752,12 +753,20 @@ acpi_ds_load2_begin_op(struct acpi_walk_ break; } - /* Add new entry into namespace */ + flags = ACPI_NS_NO_UPSEARCH; + if (walk_state->pass_number == 3) { + + /* Execution mode, node cannot already exist */ + + flags |= ACPI_NS_ERROR_IF_FOUND; + } + + /* Add new entry or lookup existing entry */ status = acpi_ns_lookup(walk_state->scope_info, buffer_ptr, - object_type, ACPI_IMODE_LOAD_PASS2, - ACPI_NS_NO_UPSEARCH, walk_state, &(node)); + object_type, ACPI_IMODE_LOAD_PASS2, flags, + walk_state, &node); break; } diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c index a02aa62..6e875ce 100644 --- a/drivers/acpi/parser/psparse.c +++ b/drivers/acpi/parser/psparse.c @@ -540,6 +540,11 @@ acpi_status acpi_ps_parse_aml(struct acp if ((status == AE_ALREADY_EXISTS) && (!walk_state->method_desc->method.mutex)) { + ACPI_INFO((AE_INFO, + "Marking method %4.4s as Serialized", + walk_state->method_node->name. + ascii)); + /* * Method tried to create an object twice. The probable cause is * that the method cannot handle reentrancy. -- 1.4.4.1