From: 杜坤明 Date: Fri, 3 Feb 2012 10:02:48 +0000 (+0800) Subject: gpu : avoid return OK when use gckOS_WaitSignal timeout. X-Git-Tag: firefly_0821_release~9646 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e92241844c59d7823fbefb60ceb014c8a2dceaf9;p=firefly-linux-kernel-4.4.55.git gpu : avoid return OK when use gckOS_WaitSignal timeout. --- diff --git a/drivers/staging/rk29/vivante/hal/inc/gc_hal_options.h b/drivers/staging/rk29/vivante/hal/inc/gc_hal_options.h index e8133d0a60cf..21f453f501f2 100644 --- a/drivers/staging/rk29/vivante/hal/inc/gc_hal_options.h +++ b/drivers/staging/rk29/vivante/hal/inc/gc_hal_options.h @@ -368,7 +368,7 @@ 0 - no use,original code 1 - use */ -#define gcdENABLE_MMU_PROTECTING 1 +#define gcdENABLE_MMU_PROTECTING 1 #endif /* __gc_hal_options_h_ */ diff --git a/drivers/staging/rk29/vivante/hal/kernel/gc_hal_kernel_mmu.c b/drivers/staging/rk29/vivante/hal/kernel/gc_hal_kernel_mmu.c index d7053961b81f..cd63265d98de 100644 --- a/drivers/staging/rk29/vivante/hal/kernel/gc_hal_kernel_mmu.c +++ b/drivers/staging/rk29/vivante/hal/kernel/gc_hal_kernel_mmu.c @@ -325,7 +325,6 @@ gckMMU_Construct( return gcvSTATUS_OK; OnError: - /* Roll back. */ if (mmu != gcvNULL) { @@ -509,7 +508,7 @@ gckMMU_AllocatePages( /* Not enough pages avaiable. */ gcmkONERROR(gcvSTATUS_OUT_OF_RESOURCES); } - + /* Grab the mutex. */ gcmkONERROR(gckOS_AcquireMutex(Mmu->os, Mmu->pageTableMutex, gcvINFINITE)); mutex = gcvTRUE; @@ -641,7 +640,6 @@ gckMMU_AllocatePages( return gcvSTATUS_OK; OnError: - if (mutex) { /* Release the mutex. */ @@ -690,7 +688,6 @@ gckMMU_FreePages( gcmkHEADER_ARG("Mmu=0x%x PageTable=0x%x PageCount=%lu", Mmu, PageTable, PageCount); - /* Verify the arguments. */ gcmkVERIFY_OBJECT(Mmu, gcvOBJ_MMU); gcmkVERIFY_ARGUMENT(PageTable != gcvNULL); diff --git a/drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_driver.c b/drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_driver.c index c958e0e88569..823e5de8b1d3 100755 --- a/drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_driver.c +++ b/drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_driver.c @@ -1003,9 +1003,12 @@ static void drv_exit(void) unregister_chrdev(major, DRV_NAME); #endif - - shutdown = 1; + + shutdown = 1; + + //hyh added return; + mdelay(100); gckGALDEVICE_Stop(galDevice); mdelay(50); diff --git a/drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_os.c index 2d6f5dc91928..1e1b0d4ae365 100755 --- a/drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_os.c +++ b/drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_os.c @@ -4557,8 +4557,13 @@ gckOS_WaitSignal( if (!signal->manualReset && timeout == 0) timeout = 1; rc = wait_for_completion_interruptible_timeout(&signal->event, timeout); + +#if 1 // dkm : avoid return OK when timeout in kernel3.0 + status = (rc == 0) ? gcvSTATUS_TIMEOUT : gcvSTATUS_OK; +#else status = ((rc == 0) && !signal->event.done) ? gcvSTATUS_TIMEOUT : gcvSTATUS_OK; +#endif /* Return status. */ gcmkFOOTER();