]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00301095 gpu:gpu hang when dma memory is used up
authorLoren Huang <b02279@freescale.com>
Thu, 27 Feb 2014 07:44:49 +0000 (15:44 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:56 +0000 (10:06 +0200)
When dma zone memory used up, gckOS_AllocateNonPagedMemory() will try to
free non paged memory cache and allocate again. Such operation will cause
 twice memory mutex request and cause gpu driver hang.

The solution is free the memory mutex at first before trying to free non
paged memory cache.

Date: Feb 27, 2014
Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Shawn Guo
(cherry picked from commit 79ed8edd23f990f6c1429154c2ee773c83bfd72e)

drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c

index 273d1173aac781262356a0faaae35a5a48b5e9a5..45c42a4908ea9e43563e6cef377c10fff02e5545 100644 (file)
@@ -2022,8 +2022,12 @@ gckOS_AllocateNonPagedMemory(
 #if gcdUSE_NON_PAGED_MEMORY_CACHE
     if(addr == gcvNULL)
     {
+            MEMORY_UNLOCK(Os);
+            locked = gcvFALSE;
             /*Free all cache and try again*/
             _FreeAllNonPagedMemoryCache(Os);
+            MEMORY_LOCK(Os);
+            locked = gcvTRUE;
             addr = dma_alloc_coherent(gcvNULL,
                 mdl->numPages * PAGE_SIZE,
                 &mdl->dmaHandle,