Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / drivers / acpi / executer / exmutex.c
index f843b22..3a39c2e 100644 (file)
@@ -61,7 +61,7 @@ acpi_ex_link_mutex(union acpi_operand_object *obj_desc,
  *
  * RETURN:      None
  *
- * DESCRIPTION: Remove a mutex from the "acquired_mutex" list
+ * DESCRIPTION: Remove a mutex from the "AcquiredMutex" list
  *
  ******************************************************************************/
 
@@ -95,7 +95,7 @@ void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc)
  *
  * RETURN:      None
  *
- * DESCRIPTION: Add a mutex to the "acquired_mutex" list for this walk
+ * DESCRIPTION: Add a mutex to the "AcquiredMutex" list for this walk
  *
  ******************************************************************************/
 
@@ -144,7 +144,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE_PTR("ex_acquire_mutex", obj_desc);
+       ACPI_FUNCTION_TRACE_PTR(ex_acquire_mutex, obj_desc);
 
        if (!obj_desc) {
                return_ACPI_STATUS(AE_BAD_PARAMETER);
@@ -161,24 +161,25 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 
        /*
         * Current Sync must be less than or equal to the sync level of the
-        * mutex.  This mechanism provides some deadlock prevention
+        * mutex. This mechanism provides some deadlock prevention
         */
        if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
                ACPI_ERROR((AE_INFO,
-                           "Cannot acquire Mutex [%4.4s], incorrect sync_level",
-                           acpi_ut_get_node_name(obj_desc->mutex.node)));
+                           "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%d)",
+                           acpi_ut_get_node_name(obj_desc->mutex.node),
+                           walk_state->thread->current_sync_level));
                return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
        }
 
        /* Support for multiple acquires by the owning thread */
 
        if (obj_desc->mutex.owner_thread) {
+
                /* Special case for Global Lock, allow all threads */
 
                if ((obj_desc->mutex.owner_thread->thread_id ==
                     walk_state->thread->thread_id) ||
-                   (obj_desc->mutex.semaphore ==
-                    acpi_gbl_global_lock_semaphore)) {
+                   (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK)) {
                        /*
                         * The mutex is already owned by this thread,
                         * just increment the acquisition depth
@@ -192,6 +193,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 
        status = acpi_ex_system_acquire_mutex(time_desc, obj_desc);
        if (ACPI_FAILURE(status)) {
+
                /* Includes failure from a timeout on time_desc */
 
                return_ACPI_STATUS(status);
@@ -232,7 +234,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("ex_release_mutex");
+       ACPI_FUNCTION_TRACE(ex_release_mutex);
 
        if (!obj_desc) {
                return_ACPI_STATUS(AE_BAD_PARAMETER);
@@ -262,12 +264,12 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
         */
        if ((obj_desc->mutex.owner_thread->thread_id !=
             walk_state->thread->thread_id)
-           && (obj_desc->mutex.semaphore != acpi_gbl_global_lock_semaphore)) {
+           && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) {
                ACPI_ERROR((AE_INFO,
                            "Thread %X cannot release Mutex [%4.4s] acquired by thread %X",
-                           walk_state->thread->thread_id,
+                           (u32) walk_state->thread->thread_id,
                            acpi_ut_get_node_name(obj_desc->mutex.node),
-                           obj_desc->mutex.owner_thread->thread_id));
+                           (u32) obj_desc->mutex.owner_thread->thread_id));
                return_ACPI_STATUS(AE_AML_NOT_OWNER);
        }
 
@@ -277,7 +279,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
         */
        if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
                ACPI_ERROR((AE_INFO,
-                           "Cannot release Mutex [%4.4s], incorrect sync_level",
+                           "Cannot release Mutex [%4.4s], incorrect SyncLevel",
                            acpi_ut_get_node_name(obj_desc->mutex.node)));
                return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
        }
@@ -286,6 +288,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
        obj_desc->mutex.acquisition_depth--;
        if (obj_desc->mutex.acquisition_depth != 0) {
+
                /* Just decrement the depth and return */
 
                return_ACPI_STATUS(AE_OK);