Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193484
b: refs/heads/master
c: e0f4028
h: refs/heads/master
v: v3
  • Loading branch information
Lin Ming authored and Len Brown committed Apr 20, 2010
1 parent 12166cb commit 4f367a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 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: f6a22b0bc417042e83117f52ab1a03696af185ab
refs/heads/master: e0f40281d52161dddeb1bc12879425266a53f26f
21 changes: 10 additions & 11 deletions trunk/drivers/acpi/acpica/exmutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,16 +359,19 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
{
acpi_status status = AE_OK;
u8 previous_sync_level;
struct acpi_thread_state *owner_thread;

ACPI_FUNCTION_TRACE(ex_release_mutex);

if (!obj_desc) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}

owner_thread = obj_desc->mutex.owner_thread;

/* The mutex must have been previously acquired in order to release it */

if (!obj_desc->mutex.owner_thread) {
if (!owner_thread) {
ACPI_ERROR((AE_INFO,
"Cannot release Mutex [%4.4s], not acquired",
acpi_ut_get_node_name(obj_desc->mutex.node)));
Expand All @@ -387,16 +390,13 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
* The Mutex is owned, but this thread must be the owner.
* Special case for Global Lock, any thread can release
*/
if ((obj_desc->mutex.owner_thread->thread_id !=
walk_state->thread->thread_id)
&& (obj_desc != acpi_gbl_global_lock_mutex)) {
if ((owner_thread->thread_id != walk_state->thread->thread_id) &&
(obj_desc != acpi_gbl_global_lock_mutex)) {
ACPI_ERROR((AE_INFO,
"Thread %p cannot release Mutex [%4.4s] acquired by thread %p",
ACPI_CAST_PTR(void, walk_state->thread->thread_id),
acpi_ut_get_node_name(obj_desc->mutex.node),
ACPI_CAST_PTR(void,
obj_desc->mutex.owner_thread->
thread_id)));
ACPI_CAST_PTR(void, owner_thread->thread_id)));
return_ACPI_STATUS(AE_AML_NOT_OWNER);
}

Expand All @@ -407,8 +407,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
* different level can only mean that the mutex ordering rule is being
* violated. This behavior is clarified in ACPI 4.0 specification.
*/
if (obj_desc->mutex.sync_level !=
walk_state->thread->current_sync_level) {
if (obj_desc->mutex.sync_level != owner_thread->current_sync_level) {
ACPI_ERROR((AE_INFO,
"Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %u current %u",
acpi_ut_get_node_name(obj_desc->mutex.node),
Expand All @@ -423,7 +422,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
* acquired, but are not released in reverse order.
*/
previous_sync_level =
walk_state->thread->acquired_mutex_list->mutex.original_sync_level;
owner_thread->acquired_mutex_list->mutex.original_sync_level;

status = acpi_ex_release_mutex_object(obj_desc);
if (ACPI_FAILURE(status)) {
Expand All @@ -434,7 +433,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,

/* Restore the previous sync_level */

walk_state->thread->current_sync_level = previous_sync_level;
owner_thread->current_sync_level = previous_sync_level;
}
return_ACPI_STATUS(status);
}
Expand Down

0 comments on commit 4f367a5

Please sign in to comment.