aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/dispatcher')
-rw-r--r--drivers/acpi/dispatcher/dsinit.c24
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c34
-rw-r--r--drivers/acpi/dispatcher/dswstate.c4
3 files changed, 29 insertions, 33 deletions
diff --git a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
index ebc07aab710c..bcd1d472b90f 100644
--- a/drivers/acpi/dispatcher/dsinit.c
+++ b/drivers/acpi/dispatcher/dsinit.c
@@ -86,20 +86,20 @@ acpi_ds_init_one_object (
86 void *context, 86 void *context,
87 void **return_value) 87 void **return_value)
88{ 88{
89 struct acpi_init_walk_info *info = (struct acpi_init_walk_info *) context;
90 struct acpi_namespace_node *node = (struct acpi_namespace_node *) obj_handle;
89 acpi_object_type type; 91 acpi_object_type type;
90 acpi_status status; 92 acpi_status status;
91 struct acpi_init_walk_info *info = (struct acpi_init_walk_info *) context;
92 93
93 94
94 ACPI_FUNCTION_NAME ("ds_init_one_object"); 95 ACPI_FUNCTION_NAME ("ds_init_one_object");
95 96
96 97
97 /* 98 /*
98 * We are only interested in objects owned by the table that 99 * We are only interested in NS nodes owned by the table that
99 * was just loaded 100 * was just loaded
100 */ 101 */
101 if (((struct acpi_namespace_node *) obj_handle)->owner_id != 102 if (node->owner_id != info->table_desc->owner_id) {
102 info->table_desc->owner_id) {
103 return (AE_OK); 103 return (AE_OK);
104 } 104 }
105 105
@@ -126,8 +126,6 @@ acpi_ds_init_one_object (
126 126
127 case ACPI_TYPE_METHOD: 127 case ACPI_TYPE_METHOD:
128 128
129 info->method_count++;
130
131 /* 129 /*
132 * Print a dot for each method unless we are going to print 130 * Print a dot for each method unless we are going to print
133 * the entire pathname 131 * the entire pathname
@@ -143,7 +141,7 @@ acpi_ds_init_one_object (
143 * on a per-table basis. Currently, we just use a global for the width. 141 * on a per-table basis. Currently, we just use a global for the width.
144 */ 142 */
145 if (info->table_desc->pointer->revision == 1) { 143 if (info->table_desc->pointer->revision == 1) {
146 ((struct acpi_namespace_node *) obj_handle)->flags |= ANOBJ_DATA_WIDTH_32; 144 node->flags |= ANOBJ_DATA_WIDTH_32;
147 } 145 }
148 146
149 /* 147 /*
@@ -153,22 +151,14 @@ acpi_ds_init_one_object (
153 status = acpi_ds_parse_method (obj_handle); 151 status = acpi_ds_parse_method (obj_handle);
154 if (ACPI_FAILURE (status)) { 152 if (ACPI_FAILURE (status)) {
155 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 153 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
156 "Method %p [%4.4s] - parse failure, %s\n", 154 "\n+Method %p [%4.4s] - parse failure, %s\n",
157 obj_handle, acpi_ut_get_node_name (obj_handle), 155 obj_handle, acpi_ut_get_node_name (obj_handle),
158 acpi_format_exception (status))); 156 acpi_format_exception (status)));
159 157
160 /* This parse failed, but we will continue parsing more methods */ 158 /* This parse failed, but we will continue parsing more methods */
161
162 break;
163 } 159 }
164 160
165 /* 161 info->method_count++;
166 * Delete the parse tree. We simply re-parse the method
167 * for every execution since there isn't much overhead
168 */
169 acpi_ns_delete_namespace_subtree (obj_handle);
170 acpi_ns_delete_namespace_by_owner (
171 ((struct acpi_namespace_node *) obj_handle)->object->method.owner_id);
172 break; 162 break;
173 163
174 164
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 1b90813cbde1..e344c06ed33f 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -58,12 +58,11 @@
58 * 58 *
59 * FUNCTION: acpi_ds_parse_method 59 * FUNCTION: acpi_ds_parse_method
60 * 60 *
61 * PARAMETERS: obj_handle - Method node 61 * PARAMETERS: Node - Method node
62 * 62 *
63 * RETURN: Status 63 * RETURN: Status
64 * 64 *
65 * DESCRIPTION: Call the parser and parse the AML that is associated with the 65 * DESCRIPTION: Parse the AML that is associated with the method.
66 * method.
67 * 66 *
68 * MUTEX: Assumes parser is locked 67 * MUTEX: Assumes parser is locked
69 * 68 *
@@ -71,30 +70,28 @@
71 70
72acpi_status 71acpi_status
73acpi_ds_parse_method ( 72acpi_ds_parse_method (
74 acpi_handle obj_handle) 73 struct acpi_namespace_node *node)
75{ 74{
76 acpi_status status; 75 acpi_status status;
77 union acpi_operand_object *obj_desc; 76 union acpi_operand_object *obj_desc;
78 union acpi_parse_object *op; 77 union acpi_parse_object *op;
79 struct acpi_namespace_node *node;
80 struct acpi_walk_state *walk_state; 78 struct acpi_walk_state *walk_state;
81 79
82 80
83 ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", obj_handle); 81 ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", node);
84 82
85 83
86 /* Parameter Validation */ 84 /* Parameter Validation */
87 85
88 if (!obj_handle) { 86 if (!node) {
89 return_ACPI_STATUS (AE_NULL_ENTRY); 87 return_ACPI_STATUS (AE_NULL_ENTRY);
90 } 88 }
91 89
92 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n", 90 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n",
93 acpi_ut_get_node_name (obj_handle), obj_handle)); 91 acpi_ut_get_node_name (node), node));
94 92
95 /* Extract the method object from the method Node */ 93 /* Extract the method object from the method Node */
96 94
97 node = (struct acpi_namespace_node *) obj_handle;
98 obj_desc = acpi_ns_get_attached_object (node); 95 obj_desc = acpi_ns_get_attached_object (node);
99 if (!obj_desc) { 96 if (!obj_desc) {
100 return_ACPI_STATUS (AE_NULL_OBJECT); 97 return_ACPI_STATUS (AE_NULL_OBJECT);
@@ -169,10 +166,18 @@ acpi_ds_parse_method (
169 166
170 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, 167 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
171 "**** [%4.4s] Parsed **** named_obj=%p Op=%p\n", 168 "**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
172 acpi_ut_get_node_name (obj_handle), obj_handle, op)); 169 acpi_ut_get_node_name (node), node, op));
170
171 /*
172 * Delete the parse tree. We simply re-parse the method for every
173 * execution since there isn't much overhead (compared to keeping lots
174 * of parse trees around)
175 */
176 acpi_ns_delete_namespace_subtree (node);
177 acpi_ns_delete_namespace_by_owner (obj_desc->method.owner_id);
173 178
174cleanup2: 179cleanup2:
175 (void) acpi_ut_release_owner_id (obj_desc->method.owner_id); 180 acpi_ut_release_owner_id (&obj_desc->method.owner_id);
176 181
177cleanup: 182cleanup:
178 acpi_ps_delete_parse_tree (op); 183 acpi_ps_delete_parse_tree (op);
@@ -391,7 +396,7 @@ acpi_ds_call_control_method (
391 /* On error, we must delete the new walk state */ 396 /* On error, we must delete the new walk state */
392 397
393cleanup: 398cleanup:
394 (void) acpi_ut_release_owner_id (obj_desc->method.owner_id); 399 acpi_ut_release_owner_id (&obj_desc->method.owner_id);
395 if (next_walk_state && (next_walk_state->method_desc)) { 400 if (next_walk_state && (next_walk_state->method_desc)) {
396 /* Decrement the thread count on the method parse tree */ 401 /* Decrement the thread count on the method parse tree */
397 402
@@ -563,8 +568,7 @@ acpi_ds_terminate_control_method (
563 */ 568 */
564 if ((walk_state->method_desc->method.concurrency == 1) && 569 if ((walk_state->method_desc->method.concurrency == 1) &&
565 (!walk_state->method_desc->method.semaphore)) { 570 (!walk_state->method_desc->method.semaphore)) {
566 status = acpi_os_create_semaphore (1, 571 status = acpi_os_create_semaphore (1, 1,
567 1,
568 &walk_state->method_desc->method.semaphore); 572 &walk_state->method_desc->method.semaphore);
569 } 573 }
570 574
@@ -595,6 +599,8 @@ acpi_ds_terminate_control_method (
595 */ 599 */
596 acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owner_id); 600 acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owner_id);
597 status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); 601 status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
602 acpi_ut_release_owner_id (&walk_state->method_desc->method.owner_id);
603
598 if (ACPI_FAILURE (status)) { 604 if (ACPI_FAILURE (status)) {
599 return_ACPI_STATUS (status); 605 return_ACPI_STATUS (status);
600 } 606 }
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c
index d360d8e89544..5621665991b5 100644
--- a/drivers/acpi/dispatcher/dswstate.c
+++ b/drivers/acpi/dispatcher/dswstate.c
@@ -744,7 +744,7 @@ acpi_ds_init_aml_walk (
744 u8 *aml_start, 744 u8 *aml_start,
745 u32 aml_length, 745 u32 aml_length,
746 struct acpi_parameter_info *info, 746 struct acpi_parameter_info *info,
747 u32 pass_number) 747 u8 pass_number)
748{ 748{
749 acpi_status status; 749 acpi_status status;
750 struct acpi_parse_state *parser_state = &walk_state->parser_state; 750 struct acpi_parse_state *parser_state = &walk_state->parser_state;
@@ -762,7 +762,7 @@ acpi_ds_init_aml_walk (
762 /* The next_op of the next_walk will be the beginning of the method */ 762 /* The next_op of the next_walk will be the beginning of the method */
763 763
764 walk_state->next_op = NULL; 764 walk_state->next_op = NULL;
765 walk_state->pass_number = (u8) pass_number; 765 walk_state->pass_number = pass_number;
766 766
767 if (info) { 767 if (info) {
768 if (info->parameter_type == ACPI_PARAM_GPE) { 768 if (info->parameter_type == ACPI_PARAM_GPE) {