Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151003
b: refs/heads/master
c: 10a3b46
h: refs/heads/master
i:
  151001: 5166bcd
  150999: 329dc35
v: v3
  • Loading branch information
Bob Moore authored and Len Brown committed May 27, 2009
1 parent 9311192 commit ae42ca3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba9e2ae443feb7231d9631ea0f62b63e26cfb9b1
refs/heads/master: 10a3b461a258f52b17fb8e35edf3625726eca9a8
21 changes: 19 additions & 2 deletions trunk/drivers/acpi/acpica/exmutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc)

if (obj_desc->mutex.prev) {
(obj_desc->mutex.prev)->mutex.next = obj_desc->mutex.next;

/*
* Migrate the previous sync level associated with this mutex to the
* previous mutex on the list so that it may be preserved. This handles
* the case where several mutexes have been acquired at the same level,
* but are not released in opposite order.
*/
(obj_desc->mutex.prev)->mutex.original_sync_level =
obj_desc->mutex.original_sync_level;
} else {
thread->acquired_mutex_list = obj_desc->mutex.next;
}
Expand Down Expand Up @@ -349,6 +358,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state)
{
acpi_status status = AE_OK;
u8 previous_sync_level;

ACPI_FUNCTION_TRACE(ex_release_mutex);

Expand Down Expand Up @@ -404,14 +414,21 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
}

/*
* Get the previous sync_level from the head of the acquired mutex list.
* This handles the case where several mutexes at the same level have been
* acquired, but are not released in reverse order.
*/
previous_sync_level =
walk_state->thread->acquired_mutex_list->mutex.original_sync_level;

status = acpi_ex_release_mutex_object(obj_desc);

if (obj_desc->mutex.acquisition_depth == 0) {

/* Restore the original sync_level */

walk_state->thread->current_sync_level =
obj_desc->mutex.original_sync_level;
walk_state->thread->current_sync_level = previous_sync_level;
}
return_ACPI_STATUS(status);
}
Expand Down

0 comments on commit ae42ca3

Please sign in to comment.