Commit 13b572a3 authored by Bob Moore's avatar Bob Moore Committed by Len Brown

ACPICA: Report error if method creates 2 objects with the same name

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: default avatarAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent ea5d8ebc
...@@ -547,6 +547,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, ...@@ -547,6 +547,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
acpi_status status; acpi_status status;
acpi_object_type object_type; acpi_object_type object_type;
char *buffer_ptr; char *buffer_ptr;
u32 flags;
ACPI_FUNCTION_TRACE(ds_load2_begin_op); ACPI_FUNCTION_TRACE(ds_load2_begin_op);
...@@ -752,12 +753,20 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, ...@@ -752,12 +753,20 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
break; 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 = status =
acpi_ns_lookup(walk_state->scope_info, buffer_ptr, acpi_ns_lookup(walk_state->scope_info, buffer_ptr,
object_type, ACPI_IMODE_LOAD_PASS2, object_type, ACPI_IMODE_LOAD_PASS2, flags,
ACPI_NS_NO_UPSEARCH, walk_state, &(node)); walk_state, &node);
break; break;
} }
......
...@@ -540,6 +540,11 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) ...@@ -540,6 +540,11 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
if ((status == AE_ALREADY_EXISTS) && if ((status == AE_ALREADY_EXISTS) &&
(!walk_state->method_desc->method.mutex)) { (!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 * Method tried to create an object twice. The probable cause is
* that the method cannot handle reentrancy. * that the method cannot handle reentrancy.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment