Commit 8813dfbf authored by Alexey Y. Starikovskiy's avatar Alexey Y. Starikovskiy Committed by Len Brown

[ACPI] Error: Invalid owner_id: 00

Signed-off-by: default avatarAlexey Y. Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 4fbd1514
...@@ -235,6 +235,16 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, ...@@ -235,6 +235,16 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
acpi_ex_system_wait_semaphore(obj_desc->method.semaphore, acpi_ex_system_wait_semaphore(obj_desc->method.semaphore,
ACPI_WAIT_FOREVER); ACPI_WAIT_FOREVER);
} }
/*
* allocate owner id for this method
*/
if (!obj_desc->method.thread_count) {
status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
}
/* /*
* Increment the method parse tree thread count since it has been * Increment the method parse tree thread count since it has been
...@@ -289,11 +299,6 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, ...@@ -289,11 +299,6 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
return_ACPI_STATUS(AE_NULL_OBJECT); return_ACPI_STATUS(AE_NULL_OBJECT);
} }
status = acpi_ut_allocate_owner_id(&obj_desc->method.owner_id);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Init for new method, wait on concurrency semaphore */ /* Init for new method, wait on concurrency semaphore */
status = acpi_ds_begin_method_execution(method_node, obj_desc, status = acpi_ds_begin_method_execution(method_node, obj_desc,
...@@ -380,22 +385,18 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, ...@@ -380,22 +385,18 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {
status = obj_desc->method.implementation(next_walk_state); status = obj_desc->method.implementation(next_walk_state);
return_ACPI_STATUS(status);
} }
goto end;
return_ACPI_STATUS(AE_OK); cleanup:
/* On error, we must delete the new walk state */
cleanup:
acpi_ut_release_owner_id(&obj_desc->method.owner_id);
if (next_walk_state && (next_walk_state->method_desc)) {
/* Decrement the thread count on the method parse tree */ /* Decrement the thread count on the method parse tree */
if (next_walk_state && (next_walk_state->method_desc)) {
next_walk_state->method_desc->method.thread_count--; next_walk_state->method_desc->method.thread_count--;
} }
(void)acpi_ds_terminate_control_method(next_walk_state); /* On error, we must delete the new walk state */
acpi_ds_delete_walk_state(next_walk_state); acpi_ds_terminate_control_method (next_walk_state);
acpi_ds_delete_walk_state (next_walk_state);
end:
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -479,7 +480,7 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, ...@@ -479,7 +480,7 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,
* *
* PARAMETERS: walk_state - State of the method * PARAMETERS: walk_state - State of the method
* *
* RETURN: Status * RETURN: None
* *
* DESCRIPTION: Terminate a control method. Delete everything that the method * DESCRIPTION: Terminate a control method. Delete everything that the method
* created, delete all locals and arguments, and delete the parse * created, delete all locals and arguments, and delete the parse
...@@ -487,7 +488,7 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, ...@@ -487,7 +488,7 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state) void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state)
{ {
union acpi_operand_object *obj_desc; union acpi_operand_object *obj_desc;
struct acpi_namespace_node *method_node; struct acpi_namespace_node *method_node;
...@@ -496,14 +497,14 @@ acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state) ...@@ -496,14 +497,14 @@ acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state)
ACPI_FUNCTION_TRACE_PTR("ds_terminate_control_method", walk_state); ACPI_FUNCTION_TRACE_PTR("ds_terminate_control_method", walk_state);
if (!walk_state) { if (!walk_state) {
return (AE_BAD_PARAMETER); return_VOID;
} }
/* The current method object was saved in the walk state */ /* The current method object was saved in the walk state */
obj_desc = walk_state->method_desc; obj_desc = walk_state->method_desc;
if (!obj_desc) { if (!obj_desc) {
return_ACPI_STATUS(AE_OK); return_VOID;
} }
/* Delete all arguments and locals */ /* Delete all arguments and locals */
...@@ -517,7 +518,7 @@ acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state) ...@@ -517,7 +518,7 @@ acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state)
*/ */
status = acpi_ut_acquire_mutex(ACPI_MTX_PARSER); status = acpi_ut_acquire_mutex(ACPI_MTX_PARSER);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_VOID;
} }
/* Signal completion of the execution of this method if necessary */ /* Signal completion of the execution of this method if necessary */
...@@ -574,7 +575,7 @@ acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state) ...@@ -574,7 +575,7 @@ acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state)
*/ */
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); goto cleanup;
} }
if (method_node->child) { if (method_node->child) {
...@@ -592,10 +593,9 @@ acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state) ...@@ -592,10 +593,9 @@ acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state)
owner_id); owner_id);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); goto cleanup;
} }
} }
cleanup:
status = acpi_ut_release_mutex(ACPI_MTX_PARSER); acpi_ut_release_mutex (ACPI_MTX_PARSER);
return_ACPI_STATUS(status);
} }
...@@ -438,7 +438,6 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state, ...@@ -438,7 +438,6 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
{ {
acpi_status status; acpi_status status;
acpi_status terminate_status;
struct acpi_thread_state *thread; struct acpi_thread_state *thread;
struct acpi_thread_state *prev_walk_list = acpi_gbl_current_walk_list; struct acpi_thread_state *prev_walk_list = acpi_gbl_current_walk_list;
struct acpi_walk_state *previous_walk_state; struct acpi_walk_state *previous_walk_state;
...@@ -508,6 +507,9 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) ...@@ -508,6 +507,9 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
walk_state->method_node, NULL, walk_state->method_node, NULL,
status); status);
/* Make sure that failed method will be cleaned as if it was executed */
walk_state->parse_flags |= ACPI_PARSE_EXECUTE;
/* Check for possible multi-thread reentrancy problem */ /* Check for possible multi-thread reentrancy problem */
if ((status == AE_ALREADY_EXISTS) && if ((status == AE_ALREADY_EXISTS) &&
...@@ -524,14 +526,6 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) ...@@ -524,14 +526,6 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
} }
} }
if (walk_state->method_desc) {
/* Decrement the thread count on the method parse tree */
if (walk_state->method_desc->method.thread_count) {
walk_state->method_desc->method.thread_count--;
}
}
/* We are done with this walk, move on to the parent if any */ /* We are done with this walk, move on to the parent if any */
walk_state = acpi_ds_pop_walk_state(thread); walk_state = acpi_ds_pop_walk_state(thread);
...@@ -546,13 +540,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) ...@@ -546,13 +540,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
*/ */
if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) ==
ACPI_PARSE_EXECUTE) { ACPI_PARSE_EXECUTE) {
terminate_status = if (walk_state->method_desc) {
acpi_ds_terminate_control_method(walk_state); walk_state->method_desc->method.thread_count--;
if (ACPI_FAILURE(terminate_status)) {
ACPI_REPORT_ERROR(("Could not terminate control method properly\n"));
/* Ignore error and continue */
} }
acpi_ds_terminate_control_method (walk_state);
} }
/* Delete this walk state and all linked control states */ /* Delete this walk state and all linked control states */
......
...@@ -98,16 +98,6 @@ acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info) ...@@ -98,16 +98,6 @@ acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
/*
* Get a new owner_id for objects created by this method. Namespace
* objects (such as Operation Regions) can be created during the
* first pass parse.
*/
status = acpi_ut_allocate_owner_id(&info->obj_desc->method.owner_id);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* /*
* The caller "owns" the parameters, so give each one an extra * The caller "owns" the parameters, so give each one an extra
* reference * reference
...@@ -139,9 +129,6 @@ acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info) ...@@ -139,9 +129,6 @@ acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info)
status = acpi_ps_execute_pass(info); status = acpi_ps_execute_pass(info);
cleanup: cleanup:
if (info->obj_desc->method.owner_id) {
acpi_ut_release_owner_id(&info->obj_desc->method.owner_id);
}
/* Take away the extra reference that we gave the parameters above */ /* Take away the extra reference that we gave the parameters above */
......
...@@ -67,6 +67,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) ...@@ -67,6 +67,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
ACPI_FUNCTION_TRACE("ut_allocate_owner_id"); ACPI_FUNCTION_TRACE("ut_allocate_owner_id");
WARN_ON(*owner_id);
/* Mutex for the global ID mask */ /* Mutex for the global ID mask */
status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES); status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES);
......
...@@ -194,7 +194,7 @@ acpi_status ...@@ -194,7 +194,7 @@ acpi_status
acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,
union acpi_operand_object *return_desc); union acpi_operand_object *return_desc);
acpi_status void
acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state);
acpi_status acpi_status
......
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