aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoren Huang <b02279@freescale.com>2014-02-27 02:44:49 -0500
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:58:20 -0400
commit8d2a9dfb83a5bf5bca083118c1ca59dda78bd11f (patch)
tree61e65c53d17527225b9cdc98cbdd7a4c676e0aa3
parent28d18f23fe7577f613ad8cfb4699bba26178304b (diff)
ENGR00301095 gpu:gpu hang when dma memory is used up
When dma zone memory used up, gckOS_AllocateCMAMemoryFSL() 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)
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
index edb86dcbd7d6..eda7e53c6f55 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
@@ -2113,8 +2113,12 @@ gckOS_AllocateCMAMemoryFSL(
2113#if gcdUSE_NON_PAGED_MEMORY_CACHE 2113#if gcdUSE_NON_PAGED_MEMORY_CACHE
2114 if(addr == gcvNULL) 2114 if(addr == gcvNULL)
2115 { 2115 {
2116 MEMORY_UNLOCK(Os);
2117 locked = gcvFALSE;
2116 /*Free all cache and try again*/ 2118 /*Free all cache and try again*/
2117 _FreeAllNonPagedMemoryCache(Os); 2119 _FreeAllNonPagedMemoryCache(Os);
2120 MEMORY_LOCK(Os);
2121 locked = gcvTRUE;
2118 addr = dma_alloc_writecombine(gcvNULL, 2122 addr = dma_alloc_writecombine(gcvNULL,
2119 mdl->numPages * PAGE_SIZE, 2123 mdl->numPages * PAGE_SIZE,
2120 &mdl->dmaHandle, 2124 &mdl->dmaHandle,