aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exmutex.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-04-10 11:06:37 -0400
committerLen Brown <len.brown@intel.com>2008-04-22 14:29:22 -0400
commitf02e9fa1ceee045f7d5c53d475032815752a2510 (patch)
tree52da78bd3ef6442418ad2dae6fa55aab964dc6b4 /drivers/acpi/executer/exmutex.c
parenta4df451a1055d97726ab890249bc3f941906fa75 (diff)
ACPICA: Misc fixes for recent global lock code update
Fixes as a result of running full validation test suite. 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.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index 32f24a8fba57..b8d035c00b61 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -156,6 +156,10 @@ acpi_ex_acquire_mutex_object(u16 timeout,
156 156
157 ACPI_FUNCTION_TRACE_PTR(ex_acquire_mutex_object, obj_desc); 157 ACPI_FUNCTION_TRACE_PTR(ex_acquire_mutex_object, obj_desc);
158 158
159 if (!obj_desc) {
160 return_ACPI_STATUS(AE_BAD_PARAMETER);
161 }
162
159 /* Support for multiple acquires by the owning thread */ 163 /* Support for multiple acquires by the owning thread */
160 164
161 if (obj_desc->mutex.thread_id == thread_id) { 165 if (obj_desc->mutex.thread_id == thread_id) {
@@ -290,6 +294,10 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
290 294
291 ACPI_FUNCTION_TRACE(ex_release_mutex_object); 295 ACPI_FUNCTION_TRACE(ex_release_mutex_object);
292 296
297 if (obj_desc->mutex.acquisition_depth == 0) {
298 return (AE_NOT_ACQUIRED);
299 }
300
293 /* Match multiple Acquires with multiple Releases */ 301 /* Match multiple Acquires with multiple Releases */
294 302
295 obj_desc->mutex.acquisition_depth--; 303 obj_desc->mutex.acquisition_depth--;
@@ -387,17 +395,22 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
387 */ 395 */
388 if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) { 396 if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
389 ACPI_ERROR((AE_INFO, 397 ACPI_ERROR((AE_INFO,
390 "Cannot release Mutex [%4.4s], incorrect SyncLevel", 398 "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %d current %d",
391 acpi_ut_get_node_name(obj_desc->mutex.node))); 399 acpi_ut_get_node_name(obj_desc->mutex.node),
400 obj_desc->mutex.sync_level,
401 walk_state->thread->current_sync_level));
392 return_ACPI_STATUS(AE_AML_MUTEX_ORDER); 402 return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
393 } 403 }
394 404
395 status = acpi_ex_release_mutex_object(obj_desc); 405 status = acpi_ex_release_mutex_object(obj_desc);
396 406
397 /* Restore the original sync_level */ 407 if (obj_desc->mutex.acquisition_depth == 0) {
408
409 /* Restore the original sync_level */
398 410
399 walk_state->thread->current_sync_level = 411 walk_state->thread->current_sync_level =
400 obj_desc->mutex.original_sync_level; 412 obj_desc->mutex.original_sync_level;
413 }
401 return_ACPI_STATUS(status); 414 return_ACPI_STATUS(status);
402} 415}
403 416