Commit 441ad11d authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki

ACPICA: Dispatcher: Fix a mutex issue for method auto serialization

ACPICA commit fd305eda14f1a1e684edef4fac53f194bf00ed3f

This patch fixes an issue with acpi_ds_auto_serialized_method().
The parser will invoke acpi_ex_release_all_mutexes(), which in return
cause mutexes held in ACPI_ERROR_METHOD() failed. Lv Zheng.

Link: https://bugs.acpica.org/show_bug.cgi?id=1324
Link: https://github.com/acpica/acpica/commit/fd305edaTested-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: default avatarGreg White <gwhite@kupulau.com>
Tested-by: default avatarDutch Guy <lucht_piloot@gmx.net>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 74f51b80
...@@ -99,11 +99,14 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node, ...@@ -99,11 +99,14 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
"Method auto-serialization parse [%4.4s] %p\n", "Method auto-serialization parse [%4.4s] %p\n",
acpi_ut_get_node_name(node), node)); acpi_ut_get_node_name(node), node));
acpi_ex_enter_interpreter();
/* Create/Init a root op for the method parse tree */ /* Create/Init a root op for the method parse tree */
op = acpi_ps_alloc_op(AML_METHOD_OP, obj_desc->method.aml_start); op = acpi_ps_alloc_op(AML_METHOD_OP, obj_desc->method.aml_start);
if (!op) { if (!op) {
return_ACPI_STATUS(AE_NO_MEMORY); status = AE_NO_MEMORY;
goto unlock;
} }
acpi_ps_set_name(op, node->name.integer); acpi_ps_set_name(op, node->name.integer);
...@@ -115,7 +118,8 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node, ...@@ -115,7 +118,8 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
acpi_ds_create_walk_state(node->owner_id, NULL, NULL, NULL); acpi_ds_create_walk_state(node->owner_id, NULL, NULL, NULL);
if (!walk_state) { if (!walk_state) {
acpi_ps_free_op(op); acpi_ps_free_op(op);
return_ACPI_STATUS(AE_NO_MEMORY); status = AE_NO_MEMORY;
goto unlock;
} }
status = acpi_ds_init_aml_walk(walk_state, op, node, status = acpi_ds_init_aml_walk(walk_state, op, node,
...@@ -134,6 +138,8 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node, ...@@ -134,6 +138,8 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
status = acpi_ps_parse_aml(walk_state); status = acpi_ps_parse_aml(walk_state);
acpi_ps_delete_parse_tree(op); acpi_ps_delete_parse_tree(op);
unlock:
acpi_ex_exit_interpreter();
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -537,9 +537,11 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) ...@@ -537,9 +537,11 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
/* Either the method parse or actual execution failed */ /* Either the method parse or actual execution failed */
acpi_ex_exit_interpreter();
ACPI_ERROR_METHOD("Method parse/execution failed", ACPI_ERROR_METHOD("Method parse/execution failed",
walk_state->method_node, NULL, walk_state->method_node, NULL,
status); status);
acpi_ex_enter_interpreter();
/* Check for possible multi-thread reentrancy problem */ /* Check for possible multi-thread reentrancy problem */
......
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