diff options
Diffstat (limited to 'drivers/acpi/dispatcher')
| -rw-r--r-- | drivers/acpi/dispatcher/dsmethod.c | 12 | ||||
| -rw-r--r-- | drivers/acpi/dispatcher/dsopcode.c | 3 | ||||
| -rw-r--r-- | drivers/acpi/dispatcher/dsutils.c | 7 | ||||
| -rw-r--r-- | drivers/acpi/dispatcher/dswstate.c | 9 |
4 files changed, 14 insertions, 17 deletions
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c index 1683e5c5b94c..1cbe61905824 100644 --- a/drivers/acpi/dispatcher/dsmethod.c +++ b/drivers/acpi/dispatcher/dsmethod.c | |||
| @@ -231,8 +231,10 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, | |||
| 231 | * Obtain the method mutex if necessary. Do not acquire mutex for a | 231 | * Obtain the method mutex if necessary. Do not acquire mutex for a |
| 232 | * recursive call. | 232 | * recursive call. |
| 233 | */ | 233 | */ |
| 234 | if (acpi_os_get_thread_id() != | 234 | if (!walk_state || |
| 235 | obj_desc->method.mutex->mutex.owner_thread_id) { | 235 | !obj_desc->method.mutex->mutex.owner_thread || |
| 236 | (walk_state->thread != | ||
| 237 | obj_desc->method.mutex->mutex.owner_thread)) { | ||
| 236 | /* | 238 | /* |
| 237 | * Acquire the method mutex. This releases the interpreter if we | 239 | * Acquire the method mutex. This releases the interpreter if we |
| 238 | * block (and reacquires it before it returns) | 240 | * block (and reacquires it before it returns) |
| @@ -246,14 +248,14 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, | |||
| 246 | } | 248 | } |
| 247 | 249 | ||
| 248 | /* Update the mutex and walk info and save the original sync_level */ | 250 | /* Update the mutex and walk info and save the original sync_level */ |
| 249 | obj_desc->method.mutex->mutex.owner_thread_id = | ||
| 250 | acpi_os_get_thread_id(); | ||
| 251 | 251 | ||
| 252 | if (walk_state) { | 252 | if (walk_state) { |
| 253 | obj_desc->method.mutex->mutex. | 253 | obj_desc->method.mutex->mutex. |
| 254 | original_sync_level = | 254 | original_sync_level = |
| 255 | walk_state->thread->current_sync_level; | 255 | walk_state->thread->current_sync_level; |
| 256 | 256 | ||
| 257 | obj_desc->method.mutex->mutex.owner_thread = | ||
| 258 | walk_state->thread; | ||
| 257 | walk_state->thread->current_sync_level = | 259 | walk_state->thread->current_sync_level = |
| 258 | obj_desc->method.sync_level; | 260 | obj_desc->method.sync_level; |
| 259 | } else { | 261 | } else { |
| @@ -567,7 +569,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, | |||
| 567 | 569 | ||
| 568 | acpi_os_release_mutex(method_desc->method.mutex->mutex. | 570 | acpi_os_release_mutex(method_desc->method.mutex->mutex. |
| 569 | os_mutex); | 571 | os_mutex); |
| 570 | method_desc->method.mutex->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED; | 572 | method_desc->method.mutex->mutex.owner_thread = NULL; |
| 571 | } | 573 | } |
| 572 | } | 574 | } |
| 573 | 575 | ||
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c index 6c6104a7a247..fc9da4879cbf 100644 --- a/drivers/acpi/dispatcher/dsopcode.c +++ b/drivers/acpi/dispatcher/dsopcode.c | |||
| @@ -866,8 +866,7 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state, | |||
| 866 | ((op->common.parent->common.aml_opcode != AML_PACKAGE_OP) && | 866 | ((op->common.parent->common.aml_opcode != AML_PACKAGE_OP) && |
| 867 | (op->common.parent->common.aml_opcode != | 867 | (op->common.parent->common.aml_opcode != |
| 868 | AML_VAR_PACKAGE_OP) | 868 | AML_VAR_PACKAGE_OP) |
| 869 | && (op->common.parent->common.aml_opcode != | 869 | && (op->common.parent->common.aml_opcode != AML_NAME_OP))) { |
| 870 | AML_NAME_OP))) { | ||
| 871 | walk_state->result_obj = obj_desc; | 870 | walk_state->result_obj = obj_desc; |
| 872 | } | 871 | } |
| 873 | } | 872 | } |
diff --git a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c index e4073e05a75c..71503c036f7c 100644 --- a/drivers/acpi/dispatcher/dsutils.c +++ b/drivers/acpi/dispatcher/dsutils.c | |||
| @@ -556,10 +556,9 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state, | |||
| 556 | * indicate this to the interpreter, set the | 556 | * indicate this to the interpreter, set the |
| 557 | * object to the root | 557 | * object to the root |
| 558 | */ | 558 | */ |
| 559 | obj_desc = | 559 | obj_desc = ACPI_CAST_PTR(union |
| 560 | ACPI_CAST_PTR(union | 560 | acpi_operand_object, |
| 561 | acpi_operand_object, | 561 | acpi_gbl_root_node); |
| 562 | acpi_gbl_root_node); | ||
| 563 | status = AE_OK; | 562 | status = AE_OK; |
| 564 | } else { | 563 | } else { |
| 565 | /* | 564 | /* |
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c index 16c8e38b51ef..5afcdd9c7449 100644 --- a/drivers/acpi/dispatcher/dswstate.c +++ b/drivers/acpi/dispatcher/dswstate.c | |||
| @@ -630,12 +630,9 @@ struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread) | |||
| 630 | * | 630 | * |
| 631 | ******************************************************************************/ | 631 | ******************************************************************************/ |
| 632 | 632 | ||
| 633 | struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, | 633 | struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union acpi_parse_object |
| 634 | union acpi_parse_object | 634 | *origin, union acpi_operand_object |
| 635 | *origin, | 635 | *method_desc, struct acpi_thread_state |
| 636 | union acpi_operand_object | ||
| 637 | *method_desc, | ||
| 638 | struct acpi_thread_state | ||
| 639 | *thread) | 636 | *thread) |
| 640 | { | 637 | { |
| 641 | struct acpi_walk_state *walk_state; | 638 | struct acpi_walk_state *walk_state; |
