summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoren Huang <b02279@freescale.com>2014-02-27 15:44:49 +0800
committerLoren Huang <b02279@freescale.com>2014-02-27 16:08:33 +0800
commit25ab542527c60caf6416c52abaa376757dbc0b09 (patch)
tree6bcecf1c498c9d6d01b106d396378db241e707f6
parent180e5249943950ef2b917414ba677a52f3d68e19 (diff)
ENGR00301095 gpu:gpu hang when dma memory is used up
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)
-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 273d1173aac7..45c42a4908ea 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
@@ -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,