SGX-BIN: Binaries and KM source with mutex nesting
authorHemant Hariyani <hemanthariyani@ti.com>
Wed, 4 Dec 2013 16:57:20 +0000 (10:57 -0600)
committerHemant Hariyani <hemanthariyani@ti.com>
Wed, 4 Dec 2013 16:57:20 +0000 (10:57 -0600)
Fixes mutex deadlock warning during boot.

Change-Id: Ieb292a7b1bba3269c8df8e8c3f836dc7b50fabd4
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
jacinto6/sgx.tgz
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutex.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_debug.c

index 7aaa04822e2a4559049212f2171ec72db5896520..9d1683bebeb51a06db5570d00162675d2abea608 100644 (file)
Binary files a/jacinto6/sgx.tgz and b/jacinto6/sgx.tgz differ
index b1947941ed6063e7f1955dc1269a850f87ab0522..56cf52ce2f95fea43a114673fc295e92ca638207 100644 (file)
@@ -317,7 +317,7 @@ DebugMemAllocRecordAdd(DEBUG_MEM_ALLOC_TYPE eAllocType,
 {
     DEBUG_MEM_ALLOC_REC *psRecord;
 
-    LinuxLockMutex(&g_sDebugMutex);
+    LinuxLockMutexNested(&g_sDebugMutex, PVRSRV_LOCK_CLASS_MM_DEBUG);
 
     psRecord = kmalloc(sizeof(DEBUG_MEM_ALLOC_REC), GFP_KERNEL);
 
@@ -412,7 +412,7 @@ DebugMemAllocRecordRemove(DEBUG_MEM_ALLOC_TYPE eAllocType, IMG_VOID *pvKey, IMG_
 {
 /*    DEBUG_MEM_ALLOC_REC **ppsCurrentRecord;*/
 
-    LinuxLockMutex(&g_sDebugMutex);
+    LinuxLockMutexNested(&g_sDebugMutex, PVRSRV_LOCK_CLASS_MM_DEBUG);
 
     /* Locate the corresponding allocation entry */
        if (!List_DEBUG_MEM_ALLOC_REC_IMG_BOOL_Any_va(g_MemoryRecords,
@@ -1968,7 +1968,7 @@ DebugLinuxMemAreaRecordAdd(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32Flags)
     DEBUG_LINUX_MEM_AREA_REC *psNewRecord;
     const IMG_CHAR *pi8FlagsString;
     
-    LinuxLockMutex(&g_sDebugMutex);
+    LinuxLockMutexNested(&g_sDebugMutex, PVRSRV_LOCK_CLASS_MM_DEBUG);
 
     if (psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC)
     {
@@ -2037,7 +2037,7 @@ DebugLinuxMemAreaRecordFind(LinuxMemArea *psLinuxMemArea)
 {
     DEBUG_LINUX_MEM_AREA_REC *psCurrentRecord;
 
-    LinuxLockMutex(&g_sDebugMutex);
+    LinuxLockMutexNested(&g_sDebugMutex, PVRSRV_LOCK_CLASS_MM_DEBUG);
        psCurrentRecord = List_DEBUG_LINUX_MEM_AREA_REC_Any_va(g_LinuxMemAreaRecords,
                                                                                                                MatchLinuxMemArea_AnyVaCb,
                                                                                                                psLinuxMemArea);
@@ -2054,7 +2054,7 @@ DebugLinuxMemAreaRecordRemove(LinuxMemArea *psLinuxMemArea)
 {
     DEBUG_LINUX_MEM_AREA_REC *psCurrentRecord;
 
-    LinuxLockMutex(&g_sDebugMutex);
+    LinuxLockMutexNested(&g_sDebugMutex, PVRSRV_LOCK_CLASS_MM_DEBUG);
 
     if (psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC)
     {
@@ -2259,7 +2259,7 @@ static void ProcSeqStartstopDebugMutex(struct seq_file *sfile, IMG_BOOL start)
 {
        if (start) 
        {
-           LinuxLockMutex(&g_sDebugMutex);             
+           LinuxLockMutexNested(&g_sDebugMutex, PVRSRV_LOCK_CLASS_MM_DEBUG);           
        }
        else
        {
index e7b161f9d83ab7009e4254ea82cdea2cc0cbada5..6d50cdbccc86592a3e78f332a82fc90c866adbbe 100644 (file)
@@ -489,7 +489,7 @@ PVR_MOD_STATIC void PVRSRVDriverShutdown(LDM_DEV *pDevice)
 {
        PVR_TRACE(("PVRSRVDriverShutdown(pDevice=%p)", pDevice));
 
-       LinuxLockMutex(&gsPMMutex);
+       LinuxLockMutexNested(&gsPMMutex, PVRSRV_LOCK_CLASS_POWER);
 
        if (!bDriverIsShutdown && !bDriverIsSuspended)
        {
@@ -555,7 +555,7 @@ PVR_MOD_STATIC int PVRSRVDriverSuspend(LDM_DEV *pDevice, pm_message_t state)
 #if !(defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL) && !defined(SUPPORT_DRI_DRM))
        PVR_TRACE(( "PVRSRVDriverSuspend(pDevice=%p)", pDevice));
 
-       LinuxLockMutex(&gsPMMutex);
+       LinuxLockMutexNested(&gsPMMutex, PVRSRV_LOCK_CLASS_POWER);
 
        if (!bDriverIsSuspended && !bDriverIsShutdown)
        {
@@ -612,7 +612,7 @@ PVR_MOD_STATIC int PVRSRVDriverResume(LDM_DEV *pDevice)
 #if !(defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL) && !defined(SUPPORT_DRI_DRM))
        PVR_TRACE(("PVRSRVDriverResume(pDevice=%p)", pDevice));
 
-       LinuxLockMutex(&gsPMMutex);
+       LinuxLockMutexNested(&gsPMMutex, PVRSRV_LOCK_CLASS_POWER);
 
        if (bDriverIsSuspended && !bDriverIsShutdown)
        {
index 816cf4a9735e45f2a31ad1eeccb65901c0eb321c..09ae46d4183e684e7982275d4e9bdda624acda90 100644 (file)
@@ -74,8 +74,11 @@ typedef struct {
 
 enum PVRSRV_MUTEX_LOCK_CLASS
 {
+       PVRSRV_LOCK_CLASS_POWER,
        PVRSRV_LOCK_CLASS_BRIDGE,
        PVRSRV_LOCK_CLASS_MMAP,
+       PVRSRV_LOCK_CLASS_MM_DEBUG,
+       PVRSRV_LOCK_CLASS_PVR_DEBUG,
 };
 
 extern IMG_VOID LinuxInitMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
index 04e42ad3afbb92a7f1e52512df5b6829c90ac5c2..3958f84fe124d9688ca6e53d8037ca0c2d7a2715 100644 (file)
@@ -128,7 +128,7 @@ static inline void GetBufferLock(unsigned long *pulLockFlags)
 #if !defined(PVR_DEBUG_ALWAYS_USE_SPINLOCK)
        else
        {
-               LinuxLockMutex(&gsDebugMutexNonIRQ);
+               LinuxLockMutexNested(&gsDebugMutexNonIRQ, PVRSRV_LOCK_CLASS_PVR_DEBUG);
        }
 #endif
 }