diff options
Diffstat (limited to 'drivers/acpi/executer/exmutex.c')
-rw-r--r-- | drivers/acpi/executer/exmutex.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c index b8d035c00b61..7c70938eef89 100644 --- a/drivers/acpi/executer/exmutex.c +++ b/drivers/acpi/executer/exmutex.c | |||
@@ -85,6 +85,7 @@ void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc) | |||
85 | } else { | 85 | } else { |
86 | thread->acquired_mutex_list = obj_desc->mutex.next; | 86 | thread->acquired_mutex_list = obj_desc->mutex.next; |
87 | } | 87 | } |
88 | return; | ||
88 | } | 89 | } |
89 | 90 | ||
90 | /******************************************************************************* | 91 | /******************************************************************************* |
@@ -298,6 +299,17 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc) | |||
298 | return (AE_NOT_ACQUIRED); | 299 | return (AE_NOT_ACQUIRED); |
299 | } | 300 | } |
300 | 301 | ||
302 | /* No obj_desc->Mutex.owner_thread for Global Lock */ | ||
303 | |||
304 | /* | ||
305 | * Mutex to be released must be at the head of acquired list to prevent | ||
306 | * deadlock. (The head of the list is the last mutex acquired.) | ||
307 | */ | ||
308 | if (obj_desc->mutex.owner_thread && | ||
309 | (obj_desc != obj_desc->mutex.owner_thread->acquired_mutex_list)) { | ||
310 | return (AE_AML_MUTEX_ORDER); | ||
311 | } | ||
312 | |||
301 | /* Match multiple Acquires with multiple Releases */ | 313 | /* Match multiple Acquires with multiple Releases */ |
302 | 314 | ||
303 | obj_desc->mutex.acquisition_depth--; | 315 | obj_desc->mutex.acquisition_depth--; |
@@ -403,6 +415,9 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
403 | } | 415 | } |
404 | 416 | ||
405 | status = acpi_ex_release_mutex_object(obj_desc); | 417 | status = acpi_ex_release_mutex_object(obj_desc); |
418 | if (ACPI_FAILURE(status)) { | ||
419 | return_ACPI_STATUS(status); | ||
420 | } | ||
406 | 421 | ||
407 | if (obj_desc->mutex.acquisition_depth == 0) { | 422 | if (obj_desc->mutex.acquisition_depth == 0) { |
408 | 423 | ||
@@ -411,6 +426,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
411 | walk_state->thread->current_sync_level = | 426 | walk_state->thread->current_sync_level = |
412 | obj_desc->mutex.original_sync_level; | 427 | obj_desc->mutex.original_sync_level; |
413 | } | 428 | } |
429 | |||
414 | return_ACPI_STATUS(status); | 430 | return_ACPI_STATUS(status); |
415 | } | 431 | } |
416 | 432 | ||