aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwu guoxing <b39297@freescale.com>2012-01-13 09:57:41 +0800
committerEric Miao <eric.miao@linaro.org>2012-01-19 19:05:04 +0800
commitc021ab8bbc1d3aeb563d7af0c89e5e0d2f14f862 (patch)
treed1b02788f5ba19d78696fda1f0909cb9903a5840
parent4026cfa27332f2e53cfbf72cc98cf4db8c2f2127 (diff)
downloadlinux-linaro-c021ab8bbc1d3aeb563d7af0c89e5e0d2f14f862.tar.gz
gpu-viv: change from mutex to completion for waiting pm events
viv code is using mutex to wait for pm events, kernel will see this as a dead lock and give a warrning, as the mutex can be hold for a long time. Signed-off-by: Wu Guoxing <b39297@freescale.com> Acked-by: Lily Zhang <r58066@freescale.com> Signed-off-by: Eric Miao <eric.miao@linaro.org>
-rw-r--r--drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c11
-rw-r--r--drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c4
3 files changed, 8 insertions, 9 deletions
diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c
index fe6c1a93bfe..16de8447b92 100644
--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c
+++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c
@@ -510,8 +510,7 @@ gckHARDWARE_Construct(
gcmkONERROR(gckOS_CreateSemaphore(Os, &hardware->globalSemaphore));
#if gcdPOWEROFF_TIMEOUT
- gcmkONERROR(gckOS_CreateMutex(Os, &hardware->powerOffSema));
- gcmkONERROR(gckOS_AcquireMutex(Os, hardware->powerOffSema, gcvINFINITE));
+ gcmkONERROR(gckOS_CreateSignal(Os, gcvFALSE, &hardware->powerOffSignal));
hardware->powerOffTimeout = gcdPOWEROFF_TIMEOUT;
#endif
@@ -543,9 +542,9 @@ OnError:
}
#if gcdPOWEROFF_TIMEOUT
- if (hardware->powerOffSema != gcvNULL)
+ if (hardware->powerOffSignal != gcvNULL)
{
- gcmkVERIFY_OK(gckOS_DeleteMutex(Os, &hardware->powerOffSema));
+ gcmkVERIFY_OK(gckOS_DestroySignal(Os, hardware->powerOffSignal));
}
#endif
@@ -595,7 +594,7 @@ gckHARDWARE_Destroy(
gcmkVERIFY_OK(gckOS_DeleteMutex(Hardware->os, Hardware->powerMutex));
#if gcdPOWEROFF_TIMEOUT
- gcmkVERIFY_OK(gckOS_DeleteMutex(Hardware->os, Hardware->powerOffSema));
+ gcmkVERIFY_OK(gckOS_DestroySignal(Hardware->os, Hardware->powerOffSignal));
#endif
/* Mark the object as unknown. */
@@ -3900,7 +3899,7 @@ gckHARDWARE_SetPowerManagementState(
if (State == gcvPOWER_IDLE)
{
- gcmkONERROR(gckOS_ReleaseMutex(os, Hardware->powerOffSema));
+ gcmkONERROR(gckOS_Signal(os, Hardware->powerOffSignal, gcvTRUE));
}
#endif
diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.h b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.h
index 37f6825563b..cd74c076152 100644
--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.h
+++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.h
@@ -78,7 +78,7 @@ struct _gckHARDWARE
#if gcdPOWEROFF_TIMEOUT
gctUINT32 powerOffTime;
- gctPOINTER powerOffSema;
+ gctSIGNAL powerOffSignal;
gctUINT32 powerOffTimeout;
#endif
};
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
index 7c0c5beae46..eba91437940 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
@@ -272,7 +272,7 @@ static int threadRoutinePM(void *ctxt)
{
/* wait for idle */
gcmkVERIFY_OK(
- gckOS_AcquireMutex(device->os, hardware->powerOffSema, gcvINFINITE));
+ gckOS_WaitSignal(device->os, hardware->powerOffSignal, gcvINFINITE));
/* We try to power off every 200 ms, until GPU is not idle */
do
@@ -1430,7 +1430,7 @@ gckGALDEVICE_Stop_Threads(
{
gckHARDWARE hardware = Device->kernels[gcvCORE_MAJOR]->hardware;
Device->killThread = gcvTRUE;
- gckOS_ReleaseSemaphore(Device->os, hardware->powerOffSema);
+ gckOS_Signal(Device->os, hardware->powerOffSignal, gcvTRUE);
kthread_stop(Device->pmThreadCtxts);
Device->pmThreadCtxts = gcvNULL;