aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2016-09-07 02:07:10 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-09-09 20:43:02 -0400
commit74f51b80a0c4ff84fbeb7f12ea43ce66934d29aa (patch)
tree005007d4cce830e74333502335e39b920819dc9f /drivers
parentc2d981aaed431c6af46f0a17907ed825946a5839 (diff)
ACPICA: Namespace: Fix dynamic table loading issues
ACPICA commit 767ee53354e0c4b7e8e7c57c6dd7bf569f0d52bb There are issues related to the namespace/interpreter locks, which causes several ACPI functionalities not specification compliant. The lock issues were detectec when we were trying to fix the functionalities (please see Link # [1] for the details). What's the lock issues? Let's first look into the namespace/interpreter lock usages inside of the object evaluation and the table loading which are the key AML interpretion code paths: Table loading: acpi_ns_load_table L(Namespace) acpi_ns_parse_table acpi_ns_one_complete_parse(LOAD_PASS1/LOAD_PASS2) acpi_ds_load1_begion_op acpi_ds_load1_end_op acpi_ds_load2_begion_op acpi_ds_load2_end_op U(Namespace) Object evaluation: acpi_ns_evaluate L(Interpreter) acpi_ps_execute_method acpi_ds_exec_begin_op acpi_ds_exec_end_op U(Interpreter) acpi_ns_load_table L(Namespace) U(Namespace) acpi_ev_initialize_region L(Namespace) U(Namespace) address_space.Setup address_space.Handler acpi_os_wait_semaphore acpi_os_acquire_mutex acpi_os_sleep L(Interpreter) U(Interpreter) L(Interpreter) acpi_ex_resolve_node_to_value U(Interpreter) acpi_ns_check_return_value Where: 1. L(Interpreter) means acquire(MTX_INTERPRETER); 2. U(Interpreter) means release(MTX_INTERPRETER); 3. L(Namespace) means acquire(MTX_NAMESPACE); 4. U(Namespace) means release(MTX_NAMESPACE); We can see that acpi_ns_exec_module_code() (which invokes acpi_ns_evaluate) is implemented in a deferred way just in order to avoid to reacquire the namespace lock. This is in fact the root cause of many other ACPICA issues: 1. We now know for sure that the module code should be executed right in place by the Windows AML interpreter. So in the current design, if the region initializations/accesses or the table loadings (where the namespace surely should be locked again) happening during the table loading period, dead lock could happen because ACPICA never unlocks the namespace during the AML interpretion. 2. ACPICA interpreter just ensures that all static namespace nodes (named objects created during the acpi_load_tables()) are created (acpi_ns_lookup()) with the correct lock held, but doesn't ensure that the named objects created by the control method are created with the same correct lock held. It requires the control methods to be executed in a serial way after "loading a table", that's why ACPICA requires method auto serialization. This patch fixes these software design issues by extending interpreter enter/exit APIs to hold both interpreter/namespace locks to ensure the lock order correctness, so that we can get these code paths: Table loading: acpi_ns_load_table E(Interpreter) acpi_ns_parse_table acpi_ns_one_complete_parse acpi_ns_execute_table X(Interpreter) acpi_ns_load_table acpi_ev_initialize_region address_space.Setup address_space.Handler acpi_os_wait_semaphore acpi_os_acquire_mutex acpi_os_sleep E(Interpreter) X(Interpreter) Object evaluation: acpi_ns_evaluate E(Interpreter) acpi_ps_execute_method X(Interpreter) acpi_ns_load_table acpi_ev_initialize_region address_space.Setup address_space.Handler acpi_os_wait_semaphore acpi_os_acquire_mutex acpi_os_sleep E(Interpreter) X(Interpreter) Where: 1. E(Interpreter) means acquire(MTX_INTERPRETER, MTX_NAMESPACE); 2. X(Interpreter) means release(MTX_NAMESPACE, MTX_INTERPRETER); After this change, we can see: 1. All namespace nodes creations are locked by the namespace lock. 2. All namespace nodes referencing are locked with the same lock. 3. But we also can notice a defact that, all namespace nodes deletions could be affected by this change. As a consequence, acpi_ns_delete_namespace_subtree() may delete a static namespace node that is still referenced by the interpreter (for example, the parser scopes). Currently, we needn't worry about the last defact because in ACPICA, table unloading is not fully functioning, its design strictly relies on the fact that when the namespace deletion happens, either the AML table or the OSPMs should have been notified and thus either the AML table or the OSPMs shouldn't reference deletion-related namespace nodes during the namespace deletion. And this change still works with the above restrictions applied. While making this a-step-forward helps us to correct the wrong grammar to pull many things back to the correct rail. And pulling things back to the correct rail in return makes it possible for us to support fully functioning table unloading after doing many cleanups. While this patch is generated, all namespace locks are examined to ensure that they can meet either of the following pattens: 1. L(Namespace) U(Namespace) 2. E(Interpreter) X(Interpreter) 3. E(Interpreter) X(Interpreter) L(Namespace) U(Namespace) E(Interpreter) X(Interpreter) We ensure this by adding X(Interpreter)/E(Interpreter) or removing U(Namespace)/L(Namespace) for those currently are executed in the following order: E(Interpreter) L(Namespace) U(Namespace) X(Interpreter) And adding E(Interpreter)/X(Interpreter) for those currently are executed in the following order: X(Interpreter) E(Interpreter) Originally, the interpreter lock is held for the execution AML opcodes, the namespace lock is held for the named object creation AML opcodes. Since they are actually same in MS interpreter (can all be executed during the table loading), we can combine the 2 locks and tune the locking code better in this way. Lv Zheng. Link: https://bugzilla.kernel.org/show_bug.cgi?id=153541 # [1] Link: https://bugzilla.kernel.org/show_bug.cgi?id=121701 # [1] Link: https://bugs.acpica.org/show_bug.cgi?id=1323 Link: https://github.com/acpica/acpica/commit/767ee533 Reported-and-tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reported-and-tested-by: Greg White <gwhite@kupulau.com> Reported-and-tested-by: Dutch Guy <lucht_piloot@gmx.net> 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/acpica/dsmethod.c4
-rw-r--r--drivers/acpi/acpica/dswload2.c7
-rw-r--r--drivers/acpi/acpica/exconfig.c14
-rw-r--r--drivers/acpi/acpica/exoparg1.c18
-rw-r--r--drivers/acpi/acpica/extrace.c25
-rw-r--r--drivers/acpi/acpica/exutils.c8
-rw-r--r--drivers/acpi/acpica/nsload.c27
-rw-r--r--drivers/acpi/acpica/nsparse.c3
-rw-r--r--drivers/acpi/acpica/psxface.c2
-rw-r--r--drivers/acpi/acpica/utaddress.c8
10 files changed, 47 insertions, 69 deletions
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 47c7b52a519c..25b387a6d8be 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -757,8 +757,10 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
757 757
758 /* Delete any direct children of (created by) this method */ 758 /* Delete any direct children of (created by) this method */
759 759
760 (void)acpi_ex_exit_interpreter();
760 acpi_ns_delete_namespace_subtree(walk_state-> 761 acpi_ns_delete_namespace_subtree(walk_state->
761 method_node); 762 method_node);
763 (void)acpi_ex_enter_interpreter();
762 764
763 /* 765 /*
764 * Delete any objects that were created by this method 766 * Delete any objects that were created by this method
@@ -769,9 +771,11 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
769 */ 771 */
770 if (method_desc->method. 772 if (method_desc->method.
771 info_flags & ACPI_METHOD_MODIFIED_NAMESPACE) { 773 info_flags & ACPI_METHOD_MODIFIED_NAMESPACE) {
774 (void)acpi_ex_exit_interpreter();
772 acpi_ns_delete_namespace_by_owner(method_desc-> 775 acpi_ns_delete_namespace_by_owner(method_desc->
773 method. 776 method.
774 owner_id); 777 owner_id);
778 (void)acpi_ex_enter_interpreter();
775 method_desc->method.info_flags &= 779 method_desc->method.info_flags &=
776 ~ACPI_METHOD_MODIFIED_NAMESPACE; 780 ~ACPI_METHOD_MODIFIED_NAMESPACE;
777 } 781 }
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c
index 762db3fa70e0..028b22a3154e 100644
--- a/drivers/acpi/acpica/dswload2.c
+++ b/drivers/acpi/acpica/dswload2.c
@@ -605,16 +605,13 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
605 if (ACPI_FAILURE(status)) { 605 if (ACPI_FAILURE(status)) {
606 return_ACPI_STATUS(status); 606 return_ACPI_STATUS(status);
607 } 607 }
608
609 acpi_ex_exit_interpreter();
610 } 608 }
611 609
610 acpi_ex_exit_interpreter();
612 status = 611 status =
613 acpi_ev_initialize_region 612 acpi_ev_initialize_region
614 (acpi_ns_get_attached_object(node), FALSE); 613 (acpi_ns_get_attached_object(node), FALSE);
615 if (walk_state->method_node) { 614 acpi_ex_enter_interpreter();
616 acpi_ex_enter_interpreter();
617 }
618 615
619 if (ACPI_FAILURE(status)) { 616 if (ACPI_FAILURE(status)) {
620 /* 617 /*
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 74dd5bac8422..578d5c832325 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -198,9 +198,10 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
198 * Find the node referenced by the root_path_string. This is the 198 * Find the node referenced by the root_path_string. This is the
199 * location within the namespace where the table will be loaded. 199 * location within the namespace where the table will be loaded.
200 */ 200 */
201 status = 201 status = acpi_ns_get_node_unlocked(start_node,
202 acpi_ns_get_node(start_node, operand[3]->string.pointer, 202 operand[3]->string.pointer,
203 ACPI_NS_SEARCH_PARENT, &parent_node); 203 ACPI_NS_SEARCH_PARENT,
204 &parent_node);
204 if (ACPI_FAILURE(status)) { 205 if (ACPI_FAILURE(status)) {
205 return_ACPI_STATUS(status); 206 return_ACPI_STATUS(status);
206 } 207 }
@@ -220,9 +221,10 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
220 221
221 /* Find the node referenced by the parameter_path_string */ 222 /* Find the node referenced by the parameter_path_string */
222 223
223 status = 224 status = acpi_ns_get_node_unlocked(start_node,
224 acpi_ns_get_node(start_node, operand[4]->string.pointer, 225 operand[4]->string.pointer,
225 ACPI_NS_SEARCH_PARENT, &parameter_node); 226 ACPI_NS_SEARCH_PARENT,
227 &parameter_node);
226 if (ACPI_FAILURE(status)) { 228 if (ACPI_FAILURE(status)) {
227 return_ACPI_STATUS(status); 229 return_ACPI_STATUS(status);
228 } 230 }
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index 6ae19cb26eb2..007300433cde 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -891,14 +891,16 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
891 * Field, so we need to resolve the node to a value. 891 * Field, so we need to resolve the node to a value.
892 */ 892 */
893 status = 893 status =
894 acpi_ns_get_node(walk_state->scope_info-> 894 acpi_ns_get_node_unlocked(walk_state->
895 scope.node, 895 scope_info->scope.
896 operand[0]->string.pointer, 896 node,
897 ACPI_NS_SEARCH_PARENT, 897 operand[0]->
898 ACPI_CAST_INDIRECT_PTR 898 string.pointer,
899 (struct 899 ACPI_NS_SEARCH_PARENT,
900 acpi_namespace_node, 900 ACPI_CAST_INDIRECT_PTR
901 &return_desc)); 901 (struct
902 acpi_namespace_node,
903 &return_desc));
902 if (ACPI_FAILURE(status)) { 904 if (ACPI_FAILURE(status)) {
903 goto cleanup; 905 goto cleanup;
904 } 906 }
diff --git a/drivers/acpi/acpica/extrace.c b/drivers/acpi/acpica/extrace.c
index b52e84841c1a..c9ca82610d77 100644
--- a/drivers/acpi/acpica/extrace.c
+++ b/drivers/acpi/acpica/extrace.c
@@ -201,7 +201,6 @@ acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
201 union acpi_operand_object *obj_desc, 201 union acpi_operand_object *obj_desc,
202 struct acpi_walk_state *walk_state) 202 struct acpi_walk_state *walk_state)
203{ 203{
204 acpi_status status;
205 char *pathname = NULL; 204 char *pathname = NULL;
206 u8 enabled = FALSE; 205 u8 enabled = FALSE;
207 206
@@ -211,11 +210,6 @@ acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
211 pathname = acpi_ns_get_normalized_pathname(method_node, TRUE); 210 pathname = acpi_ns_get_normalized_pathname(method_node, TRUE);
212 } 211 }
213 212
214 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
215 if (ACPI_FAILURE(status)) {
216 goto exit;
217 }
218
219 enabled = acpi_ex_interpreter_trace_enabled(pathname); 213 enabled = acpi_ex_interpreter_trace_enabled(pathname);
220 if (enabled && !acpi_gbl_trace_method_object) { 214 if (enabled && !acpi_gbl_trace_method_object) {
221 acpi_gbl_trace_method_object = obj_desc; 215 acpi_gbl_trace_method_object = obj_desc;
@@ -233,9 +227,6 @@ acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
233 } 227 }
234 } 228 }
235 229
236 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
237
238exit:
239 if (enabled) { 230 if (enabled) {
240 ACPI_TRACE_POINT(ACPI_TRACE_AML_METHOD, TRUE, 231 ACPI_TRACE_POINT(ACPI_TRACE_AML_METHOD, TRUE,
241 obj_desc ? obj_desc->method.aml_start : NULL, 232 obj_desc ? obj_desc->method.aml_start : NULL,
@@ -267,7 +258,6 @@ acpi_ex_stop_trace_method(struct acpi_namespace_node *method_node,
267 union acpi_operand_object *obj_desc, 258 union acpi_operand_object *obj_desc,
268 struct acpi_walk_state *walk_state) 259 struct acpi_walk_state *walk_state)
269{ 260{
270 acpi_status status;
271 char *pathname = NULL; 261 char *pathname = NULL;
272 u8 enabled; 262 u8 enabled;
273 263
@@ -277,26 +267,14 @@ acpi_ex_stop_trace_method(struct acpi_namespace_node *method_node,
277 pathname = acpi_ns_get_normalized_pathname(method_node, TRUE); 267 pathname = acpi_ns_get_normalized_pathname(method_node, TRUE);
278 } 268 }
279 269
280 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
281 if (ACPI_FAILURE(status)) {
282 goto exit_path;
283 }
284
285 enabled = acpi_ex_interpreter_trace_enabled(NULL); 270 enabled = acpi_ex_interpreter_trace_enabled(NULL);
286 271
287 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
288
289 if (enabled) { 272 if (enabled) {
290 ACPI_TRACE_POINT(ACPI_TRACE_AML_METHOD, FALSE, 273 ACPI_TRACE_POINT(ACPI_TRACE_AML_METHOD, FALSE,
291 obj_desc ? obj_desc->method.aml_start : NULL, 274 obj_desc ? obj_desc->method.aml_start : NULL,
292 pathname); 275 pathname);
293 } 276 }
294 277
295 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
296 if (ACPI_FAILURE(status)) {
297 goto exit_path;
298 }
299
300 /* Check whether the tracer should be stopped */ 278 /* Check whether the tracer should be stopped */
301 279
302 if (acpi_gbl_trace_method_object == obj_desc) { 280 if (acpi_gbl_trace_method_object == obj_desc) {
@@ -312,9 +290,6 @@ acpi_ex_stop_trace_method(struct acpi_namespace_node *method_node,
312 acpi_gbl_trace_method_object = NULL; 290 acpi_gbl_trace_method_object = NULL;
313 } 291 }
314 292
315 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
316
317exit_path:
318 if (pathname) { 293 if (pathname) {
319 ACPI_FREE(pathname); 294 ACPI_FREE(pathname);
320 } 295 }
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c
index 425f13372e68..a8b857a7e9fb 100644
--- a/drivers/acpi/acpica/exutils.c
+++ b/drivers/acpi/acpica/exutils.c
@@ -94,6 +94,10 @@ void acpi_ex_enter_interpreter(void)
94 ACPI_ERROR((AE_INFO, 94 ACPI_ERROR((AE_INFO,
95 "Could not acquire AML Interpreter mutex")); 95 "Could not acquire AML Interpreter mutex"));
96 } 96 }
97 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
98 if (ACPI_FAILURE(status)) {
99 ACPI_ERROR((AE_INFO, "Could not acquire AML Namespace mutex"));
100 }
97 101
98 return_VOID; 102 return_VOID;
99} 103}
@@ -127,6 +131,10 @@ void acpi_ex_exit_interpreter(void)
127 131
128 ACPI_FUNCTION_TRACE(ex_exit_interpreter); 132 ACPI_FUNCTION_TRACE(ex_exit_interpreter);
129 133
134 status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
135 if (ACPI_FAILURE(status)) {
136 ACPI_ERROR((AE_INFO, "Could not release AML Namespace mutex"));
137 }
130 status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); 138 status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
131 if (ACPI_FAILURE(status)) { 139 if (ACPI_FAILURE(status)) {
132 ACPI_ERROR((AE_INFO, 140 ACPI_ERROR((AE_INFO,
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c
index 2daa9a093c56..334d3c5ba617 100644
--- a/drivers/acpi/acpica/nsload.c
+++ b/drivers/acpi/acpica/nsload.c
@@ -46,6 +46,7 @@
46#include "acnamesp.h" 46#include "acnamesp.h"
47#include "acdispat.h" 47#include "acdispat.h"
48#include "actables.h" 48#include "actables.h"
49#include "acinterp.h"
49 50
50#define _COMPONENT ACPI_NAMESPACE 51#define _COMPONENT ACPI_NAMESPACE
51ACPI_MODULE_NAME("nsload") 52ACPI_MODULE_NAME("nsload")
@@ -78,20 +79,6 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
78 79
79 ACPI_FUNCTION_TRACE(ns_load_table); 80 ACPI_FUNCTION_TRACE(ns_load_table);
80 81
81 /*
82 * Parse the table and load the namespace with all named
83 * objects found within. Control methods are NOT parsed
84 * at this time. In fact, the control methods cannot be
85 * parsed until the entire namespace is loaded, because
86 * if a control method makes a forward reference (call)
87 * to another control method, we can't continue parsing
88 * because we don't know how many arguments to parse next!
89 */
90 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
91 if (ACPI_FAILURE(status)) {
92 return_ACPI_STATUS(status);
93 }
94
95 /* If table already loaded into namespace, just return */ 82 /* If table already loaded into namespace, just return */
96 83
97 if (acpi_tb_is_table_loaded(table_index)) { 84 if (acpi_tb_is_table_loaded(table_index)) {
@@ -107,6 +94,15 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
107 goto unlock; 94 goto unlock;
108 } 95 }
109 96
97 /*
98 * Parse the table and load the namespace with all named
99 * objects found within. Control methods are NOT parsed
100 * at this time. In fact, the control methods cannot be
101 * parsed until the entire namespace is loaded, because
102 * if a control method makes a forward reference (call)
103 * to another control method, we can't continue parsing
104 * because we don't know how many arguments to parse next!
105 */
110 status = acpi_ns_parse_table(table_index, node); 106 status = acpi_ns_parse_table(table_index, node);
111 if (ACPI_SUCCESS(status)) { 107 if (ACPI_SUCCESS(status)) {
112 acpi_tb_set_table_loaded_flag(table_index, TRUE); 108 acpi_tb_set_table_loaded_flag(table_index, TRUE);
@@ -120,7 +116,6 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
120 * exist. This target of Scope must already exist in the 116 * exist. This target of Scope must already exist in the
121 * namespace, as per the ACPI specification. 117 * namespace, as per the ACPI specification.
122 */ 118 */
123 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
124 acpi_ns_delete_namespace_by_owner(acpi_gbl_root_table_list. 119 acpi_ns_delete_namespace_by_owner(acpi_gbl_root_table_list.
125 tables[table_index].owner_id); 120 tables[table_index].owner_id);
126 121
@@ -129,8 +124,6 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
129 } 124 }
130 125
131unlock: 126unlock:
132 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
133
134 if (ACPI_FAILURE(status)) { 127 if (ACPI_FAILURE(status)) {
135 return_ACPI_STATUS(status); 128 return_ACPI_STATUS(status);
136 } 129 }
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c
index e51012b90118..4f14e9205bff 100644
--- a/drivers/acpi/acpica/nsparse.c
+++ b/drivers/acpi/acpica/nsparse.c
@@ -47,6 +47,7 @@
47#include "acparser.h" 47#include "acparser.h"
48#include "acdispat.h" 48#include "acdispat.h"
49#include "actables.h" 49#include "actables.h"
50#include "acinterp.h"
50 51
51#define _COMPONENT ACPI_NAMESPACE 52#define _COMPONENT ACPI_NAMESPACE
52ACPI_MODULE_NAME("nsparse") 53ACPI_MODULE_NAME("nsparse")
@@ -234,7 +235,9 @@ acpi_ns_one_complete_parse(u32 pass_number,
234 235
235 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, 236 ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
236 "*PARSE* pass %u parse\n", pass_number)); 237 "*PARSE* pass %u parse\n", pass_number));
238 acpi_ex_enter_interpreter();
237 status = acpi_ps_parse_aml(walk_state); 239 status = acpi_ps_parse_aml(walk_state);
240 acpi_ex_exit_interpreter();
238 241
239cleanup: 242cleanup:
240 acpi_ps_delete_parse_tree(parse_root); 243 acpi_ps_delete_parse_tree(parse_root);
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c
index 22a52c28c048..8d7e5b59b598 100644
--- a/drivers/acpi/acpica/psxface.c
+++ b/drivers/acpi/acpica/psxface.c
@@ -308,7 +308,9 @@ acpi_status acpi_ps_execute_table(struct acpi_evaluate_info *info)
308 /* 308 /*
309 * Parse the AML, walk_state will be deleted by parse_aml 309 * Parse the AML, walk_state will be deleted by parse_aml
310 */ 310 */
311 acpi_ex_enter_interpreter();
311 status = acpi_ps_parse_aml(walk_state); 312 status = acpi_ps_parse_aml(walk_state);
313 acpi_ex_exit_interpreter();
312 walk_state = NULL; 314 walk_state = NULL;
313 315
314cleanup: 316cleanup:
diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c
index c986ec66a118..433d822798b6 100644
--- a/drivers/acpi/acpica/utaddress.c
+++ b/drivers/acpi/acpica/utaddress.c
@@ -77,7 +77,6 @@ acpi_ut_add_address_range(acpi_adr_space_type space_id,
77 u32 length, struct acpi_namespace_node *region_node) 77 u32 length, struct acpi_namespace_node *region_node)
78{ 78{
79 struct acpi_address_range *range_info; 79 struct acpi_address_range *range_info;
80 acpi_status status;
81 80
82 ACPI_FUNCTION_TRACE(ut_add_address_range); 81 ACPI_FUNCTION_TRACE(ut_add_address_range);
83 82
@@ -97,12 +96,6 @@ acpi_ut_add_address_range(acpi_adr_space_type space_id,
97 range_info->end_address = (address + length - 1); 96 range_info->end_address = (address + length - 1);
98 range_info->region_node = region_node; 97 range_info->region_node = region_node;
99 98
100 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
101 if (ACPI_FAILURE(status)) {
102 ACPI_FREE(range_info);
103 return_ACPI_STATUS(status);
104 }
105
106 range_info->next = acpi_gbl_address_range_list[space_id]; 99 range_info->next = acpi_gbl_address_range_list[space_id];
107 acpi_gbl_address_range_list[space_id] = range_info; 100 acpi_gbl_address_range_list[space_id] = range_info;
108 101
@@ -112,7 +105,6 @@ acpi_ut_add_address_range(acpi_adr_space_type space_id,
112 ACPI_FORMAT_UINT64(address), 105 ACPI_FORMAT_UINT64(address),
113 ACPI_FORMAT_UINT64(range_info->end_address))); 106 ACPI_FORMAT_UINT64(range_info->end_address)));
114 107
115 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
116 return_ACPI_STATUS(AE_OK); 108 return_ACPI_STATUS(AE_OK);
117} 109}
118 110