aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/dswload.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/dswload.c')
-rw-r--r--drivers/acpi/acpica/dswload.c64
1 files changed, 39 insertions, 25 deletions
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index 10fc78517843..b40513dd6a6a 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -212,18 +212,19 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
212 case ACPI_TYPE_BUFFER: 212 case ACPI_TYPE_BUFFER:
213 213
214 /* 214 /*
215 * These types we will allow, but we will change the type. This 215 * These types we will allow, but we will change the type.
216 * enables some existing code of the form: 216 * This enables some existing code of the form:
217 * 217 *
218 * Name (DEB, 0) 218 * Name (DEB, 0)
219 * Scope (DEB) { ... } 219 * Scope (DEB) { ... }
220 * 220 *
221 * Note: silently change the type here. On the second pass, we will report 221 * Note: silently change the type here. On the second pass,
222 * a warning 222 * we will report a warning
223 */ 223 */
224 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 224 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
225 "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", 225 "Type override - [%4.4s] had invalid type (%s) "
226 path, 226 "for Scope operator, changed to type ANY\n",
227 acpi_ut_get_node_name(node),
227 acpi_ut_get_type_name(node->type))); 228 acpi_ut_get_type_name(node->type)));
228 229
229 node->type = ACPI_TYPE_ANY; 230 node->type = ACPI_TYPE_ANY;
@@ -235,8 +236,10 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
235 /* All other types are an error */ 236 /* All other types are an error */
236 237
237 ACPI_ERROR((AE_INFO, 238 ACPI_ERROR((AE_INFO,
238 "Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)", 239 "Invalid type (%s) for target of "
239 acpi_ut_get_type_name(node->type), path)); 240 "Scope operator [%4.4s] (Cannot override)",
241 acpi_ut_get_type_name(node->type),
242 acpi_ut_get_node_name(node)));
240 243
241 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 244 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
242 } 245 }
@@ -697,15 +700,16 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
697 case ACPI_TYPE_BUFFER: 700 case ACPI_TYPE_BUFFER:
698 701
699 /* 702 /*
700 * These types we will allow, but we will change the type. This 703 * These types we will allow, but we will change the type.
701 * enables some existing code of the form: 704 * This enables some existing code of the form:
702 * 705 *
703 * Name (DEB, 0) 706 * Name (DEB, 0)
704 * Scope (DEB) { ... } 707 * Scope (DEB) { ... }
705 */ 708 */
706 ACPI_WARNING((AE_INFO, 709 ACPI_WARNING((AE_INFO,
707 "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", 710 "Type override - [%4.4s] had invalid type (%s) "
708 buffer_ptr, 711 "for Scope operator, changed to type ANY\n",
712 acpi_ut_get_node_name(node),
709 acpi_ut_get_type_name(node->type))); 713 acpi_ut_get_type_name(node->type)));
710 714
711 node->type = ACPI_TYPE_ANY; 715 node->type = ACPI_TYPE_ANY;
@@ -717,9 +721,10 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
717 /* All other types are an error */ 721 /* All other types are an error */
718 722
719 ACPI_ERROR((AE_INFO, 723 ACPI_ERROR((AE_INFO,
720 "Invalid type (%s) for target of Scope operator [%4.4s]", 724 "Invalid type (%s) for target of "
725 "Scope operator [%4.4s] (Cannot override)",
721 acpi_ut_get_type_name(node->type), 726 acpi_ut_get_type_name(node->type),
722 buffer_ptr)); 727 acpi_ut_get_node_name(node)));
723 728
724 return (AE_AML_OPERAND_TYPE); 729 return (AE_AML_OPERAND_TYPE);
725 } 730 }
@@ -1047,9 +1052,22 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
1047 } 1052 }
1048 1053
1049 /* 1054 /*
1050 * If we are executing a method, initialize the region 1055 * The op_region is not fully parsed at this time. The only valid
1056 * argument is the space_id. (We must save the address of the
1057 * AML of the address and length operands)
1058 *
1059 * If we have a valid region, initialize it. The namespace is
1060 * unlocked at this point.
1061 *
1062 * Need to unlock interpreter if it is locked (if we are running
1063 * a control method), in order to allow _REG methods to be run
1064 * during acpi_ev_initialize_region.
1051 */ 1065 */
1052 if (walk_state->method_node) { 1066 if (walk_state->method_node) {
1067 /*
1068 * Executing a method: initialize the region and unlock
1069 * the interpreter
1070 */
1053 status = 1071 status =
1054 acpi_ex_create_region(op->named.data, 1072 acpi_ex_create_region(op->named.data,
1055 op->named.length, 1073 op->named.length,
@@ -1058,21 +1076,17 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
1058 if (ACPI_FAILURE(status)) { 1076 if (ACPI_FAILURE(status)) {
1059 return (status); 1077 return (status);
1060 } 1078 }
1061 }
1062 1079
1063 /* 1080 acpi_ex_exit_interpreter();
1064 * The op_region is not fully parsed at this time. Only valid 1081 }
1065 * argument is the space_id. (We must save the address of the
1066 * AML of the address and length operands)
1067 */
1068 1082
1069 /*
1070 * If we have a valid region, initialize it
1071 * Namespace is NOT locked at this point.
1072 */
1073 status = 1083 status =
1074 acpi_ev_initialize_region 1084 acpi_ev_initialize_region
1075 (acpi_ns_get_attached_object(node), FALSE); 1085 (acpi_ns_get_attached_object(node), FALSE);
1086 if (walk_state->method_node) {
1087 acpi_ex_enter_interpreter();
1088 }
1089
1076 if (ACPI_FAILURE(status)) { 1090 if (ACPI_FAILURE(status)) {
1077 /* 1091 /*
1078 * If AE_NOT_EXIST is returned, it is not fatal 1092 * If AE_NOT_EXIST is returned, it is not fatal