summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRichard Liu <r66033@freescale.com>2014-04-01 09:58:49 +0800
committerLoren Huang <b02279@freescale.com>2014-04-01 14:40:42 +0800
commit3b41f2944c00c410321a913d7455605217539028 (patch)
tree2a375026beb2f0ea32f0a64607bf9bf80e5a2dd6 /drivers
parent5d0d4e1558fa0c235691436e1c5d26d9c8950775 (diff)
ENGR00306257 [#1027]fix system hang up issue caused by GPU
This issue happens when multiple thread is trying to idle GPU at the same time, root cause is some wrong logic related with powerMutex which cause cpu still access GPU AHB register after GPU is suspend(clock off), that cause the bus lockup and make the whole system hang. Signed-off-by: Richard Liu <r66033@freescale.com> Acked-by: Jason Liu (cherry picked from commit d48e52700c4177e94695cdbdb480cb38a88a5ddc)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
index 94593d8e9968..01f71d8e4176 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
@@ -201,11 +201,9 @@ _TryToIdleGPU(
{
gceSTATUS status;
gctBOOL empty = gcvFALSE, idle = gcvFALSE;
- gctUINT32 process, thread;
gctBOOL powerLocked = gcvFALSE;
gckHARDWARE hardware;
-
gcmkHEADER_ARG("Event=0x%x", Event);
/* Verify the arguments. */
@@ -215,7 +213,6 @@ _TryToIdleGPU(
hardware = Event->kernel->hardware;
gcmkVERIFY_OBJECT(hardware, gcvOBJ_HARDWARE);
-
/* Check whether the event queue is empty. */
gcmkONERROR(gckEVENT_IsEmpty(Event, &empty));
@@ -224,30 +221,17 @@ _TryToIdleGPU(
status = gckOS_AcquireMutex(hardware->os, hardware->powerMutex, 0);
if (status == gcvSTATUS_TIMEOUT)
{
- gcmkONERROR(gckOS_GetProcessID(&process));
- gcmkONERROR(gckOS_GetThreadID(&thread));
-
- /* Just return to prevent deadlock. */
- if ((hardware->powerProcess != process)
- || (hardware->powerThread != thread))
- {
- gcmkFOOTER_NO();
- return gcvSTATUS_OK;
- }
- }
- else
- {
- powerLocked = gcvTRUE;
+ gcmkFOOTER_NO();
+ return gcvSTATUS_OK;
}
+ powerLocked = gcvTRUE;
+
/* Query whether the hardware is idle. */
gcmkONERROR(gckHARDWARE_QueryIdle(Event->kernel->hardware, &idle));
- if (powerLocked)
- {
- gcmkONERROR(gckOS_ReleaseMutex(hardware->os, hardware->powerMutex));
- powerLocked = gcvFALSE;
- }
+ gcmkONERROR(gckOS_ReleaseMutex(hardware->os, hardware->powerMutex));
+ powerLocked = gcvFALSE;
if (idle)
{
@@ -262,7 +246,6 @@ _TryToIdleGPU(
return gcvSTATUS_OK;
OnError:
-
if (powerLocked)
{
gcmkONERROR(gckOS_ReleaseMutex(hardware->os, hardware->powerMutex));