diff options
Diffstat (limited to 'drivers/acpi/utilities/utmisc.c')
-rw-r--r-- | drivers/acpi/utilities/utmisc.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c index f6de4ed3d527..bb658777fa88 100644 --- a/drivers/acpi/utilities/utmisc.c +++ b/drivers/acpi/utilities/utmisc.c | |||
@@ -787,7 +787,6 @@ acpi_ut_release_mutex ( | |||
787 | acpi_mutex_handle mutex_id) | 787 | acpi_mutex_handle mutex_id) |
788 | { | 788 | { |
789 | acpi_status status; | 789 | acpi_status status; |
790 | u32 i; | ||
791 | u32 this_thread_id; | 790 | u32 this_thread_id; |
792 | 791 | ||
793 | 792 | ||
@@ -814,25 +813,32 @@ acpi_ut_release_mutex ( | |||
814 | return (AE_NOT_ACQUIRED); | 813 | return (AE_NOT_ACQUIRED); |
815 | } | 814 | } |
816 | 815 | ||
817 | /* | 816 | #ifdef ACPI_MUTEX_DEBUG |
818 | * Deadlock prevention. Check if this thread owns any mutexes of value | 817 | { |
819 | * greater than this one. If so, the thread has violated the mutex | 818 | u32 i; |
820 | * ordering rule. This indicates a coding error somewhere in | 819 | /* |
821 | * the ACPI subsystem code. | 820 | * Mutex debug code, for internal debugging only. |
822 | */ | 821 | * |
823 | for (i = mutex_id; i < MAX_MUTEX; i++) { | 822 | * Deadlock prevention. Check if this thread owns any mutexes of value |
824 | if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) { | 823 | * greater than this one. If so, the thread has violated the mutex |
825 | if (i == mutex_id) { | 824 | * ordering rule. This indicates a coding error somewhere in |
826 | continue; | 825 | * the ACPI subsystem code. |
827 | } | 826 | */ |
827 | for (i = mutex_id; i < MAX_MUTEX; i++) { | ||
828 | if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) { | ||
829 | if (i == mutex_id) { | ||
830 | continue; | ||
831 | } | ||
828 | 832 | ||
829 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, | 833 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, |
830 | "Invalid release order: owns [%s], releasing [%s]\n", | 834 | "Invalid release order: owns [%s], releasing [%s]\n", |
831 | acpi_ut_get_mutex_name (i), acpi_ut_get_mutex_name (mutex_id))); | 835 | acpi_ut_get_mutex_name (i), acpi_ut_get_mutex_name (mutex_id))); |
832 | 836 | ||
833 | return (AE_RELEASE_DEADLOCK); | 837 | return (AE_RELEASE_DEADLOCK); |
838 | } | ||
834 | } | 839 | } |
835 | } | 840 | } |
841 | #endif | ||
836 | 842 | ||
837 | /* Mark unlocked FIRST */ | 843 | /* Mark unlocked FIRST */ |
838 | 844 | ||