aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2009-05-20 22:04:33 -0400
committerLen Brown <len.brown@intel.com>2009-05-27 00:32:24 -0400
commit315c728887f198d12eb6ec7ef9d88483018c11cb (patch)
tree113a26776f42e45d7431123307f845e3cb3ecd93 /drivers/acpi/acpica
parent10a3b461a258f52b17fb8e35edf3625726eca9a8 (diff)
ACPICA: Fix allowable release order for ASL mutex objects
The ACPI 4.0 specification has been changed to make the SyncLevel for mutex objects more useful. When releasing a mutex, the synclevel of the mutex must now be the same as the current sync level. This makes more sense. This change updates the code to match the spec. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r--drivers/acpi/acpica/exmutex.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c
index 77a592aa53c0..2f0114202b05 100644
--- a/drivers/acpi/acpica/exmutex.c
+++ b/drivers/acpi/acpica/exmutex.c
@@ -402,10 +402,14 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
402 } 402 }
403 403
404 /* 404 /*
405 * The sync level of the mutex must be less than or equal to the current 405 * The sync level of the mutex must be equal to the current sync level. In
406 * sync level 406 * other words, the current level means that at least one mutex at that
407 * level is currently being held. Attempting to release a mutex of a
408 * different level can only mean that the mutex ordering rule is being
409 * violated. This behavior is clarified in ACPI 4.0 specification.
407 */ 410 */
408 if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) { 411 if (obj_desc->mutex.sync_level !=
412 walk_state->thread->current_sync_level) {
409 ACPI_ERROR((AE_INFO, 413 ACPI_ERROR((AE_INFO,
410 "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %d current %d", 414 "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %d current %d",
411 acpi_ut_get_node_name(obj_desc->mutex.node), 415 acpi_ut_get_node_name(obj_desc->mutex.node),
@@ -423,10 +427,13 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
423 walk_state->thread->acquired_mutex_list->mutex.original_sync_level; 427 walk_state->thread->acquired_mutex_list->mutex.original_sync_level;
424 428
425 status = acpi_ex_release_mutex_object(obj_desc); 429 status = acpi_ex_release_mutex_object(obj_desc);
430 if (ACPI_FAILURE(status)) {
431 return_ACPI_STATUS(status);
432 }
426 433
427 if (obj_desc->mutex.acquisition_depth == 0) { 434 if (obj_desc->mutex.acquisition_depth == 0) {
428 435
429 /* Restore the original sync_level */ 436 /* Restore the previous sync_level */
430 437
431 walk_state->thread->current_sync_level = previous_sync_level; 438 walk_state->thread->current_sync_level = previous_sync_level;
432 } 439 }