summaryrefslogtreecommitdiff
path: root/drivers/acpi/executer/exmutex.c
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2008-04-10 19:06:41 +0400
committerLen Brown <len.brown@intel.com>2008-04-22 14:29:28 -0400
commit941f48bb465b0b291f8435b1e3de95b0975b84bc (patch)
tree42327b3d29fbaa55827abfe620a94320f86b6eb4 /drivers/acpi/executer/exmutex.c
parent9aa6169f471771324b476a90d9392daa06d63a2d (diff)
ACPICA: Implemented full support for deferred execution for the TermArg string arguments for DataTableRegion
This enables forward references and full operand resolution for the three string arguments. Similar to OperationRegion deferred argument execution.) http://www.acpica.org/bugzilla/show_bug.cgi?id=430 Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer/exmutex.c')
-rw-r--r--drivers/acpi/executer/exmutex.c16
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)
} else {
thread->acquired_mutex_list = obj_desc->mutex.next;
}
+ return;
}
/*******************************************************************************
@@ -298,6 +299,17 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
return (AE_NOT_ACQUIRED);
}
+ /* No obj_desc->Mutex.owner_thread for Global Lock */
+
+ /*
+ * Mutex to be released must be at the head of acquired list to prevent
+ * deadlock. (The head of the list is the last mutex acquired.)
+ */
+ if (obj_desc->mutex.owner_thread &&
+ (obj_desc != obj_desc->mutex.owner_thread->acquired_mutex_list)) {
+ return (AE_AML_MUTEX_ORDER);
+ }
+
/* Match multiple Acquires with multiple Releases */
obj_desc->mutex.acquisition_depth--;
@@ -403,6 +415,9 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
}
status = acpi_ex_release_mutex_object(obj_desc);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
if (obj_desc->mutex.acquisition_depth == 0) {
@@ -411,6 +426,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
walk_state->thread->current_sync_level =
obj_desc->mutex.original_sync_level;
}
+
return_ACPI_STATUS(status);
}