summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Liu <r66033@freescale.com>2013-10-25 16:57:06 +0800
committerRichard Liu <r66033@freescale.com>2013-10-25 17:20:40 +0800
commite1c08484abcf7ab12e986a11c01e193e70a9f95f (patch)
treec0f7259ce5e0368cf2870147115703b8d9bdcc77
parentd3d6949649c522ae692287de2b12c744676076aa (diff)
ENGR00284988 Camera recording kernel crash on WFD sourcejb4.3_1.0.0-ga
Fix kernel crash issue meet when do 720p Camera recording on WFD source side, the crash is related with timer schedule, fixed by add protection code in gckOS_StartTimer function. Kernel crash log: [<c004ffec>] (__bug+0x1c/0x28) from [<c00a7e00>] (queue_delayed_work_on+0x10c/0x148) [<c00a7e00>] (queue_delayed_work_on+0x10c/0x148) from [<c046f4d0>] (gckOS_StartTimer+0x44/0x84) [<c046f4d0>] (gckOS_StartTimer+0x44/0x84) from [<c047f4ac>] (gckHARDWARE_SetPowerManagementState+0xa24/0xa5c) [<c047f4ac>] (gckHARDWARE_SetPowerManagementState+0xa24/0xa5c) from [<c046e608>] (gckOS_Broadcast+0xb8/0xe8) [<c046e608>] (gckOS_Broadcast+0xb8/0xe8) from [<c0475734>] (_TryToIdleGPU+0xd8/0x18c) [<c0475734>] (_TryToIdleGPU+0xd8/0x18c) from [<c0476cdc>] (gckEVENT_Notify+0x2dc/0x4c8) [<c0476cdc>] (gckEVENT_Notify+0x2dc/0x4c8) from [<c047d494>] (gckHARDWARE_Interrupt+0x58/0x68) [<c047d494>] (gckHARDWARE_Interrupt+0x58/0x68) from [<c04693a8>] (threadRoutine+0x20/0x78) [<c04693a8>] (threadRoutine+0x20/0x78) from [<c00ad0c8>] (kthread+0x80/0x88) [<c00ad0c8>] (kthread+0x80/0x88) from [<c004d408>] (kernel_thread_exit+0x0/0x8) Signed-off-by: Richard Liu <r66033@freescale.com> Acked-by: Jason Liu
-rw-r--r--drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c17
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c12
2 files changed, 28 insertions, 1 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 64929350f567..2d7f629e28d8 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
@@ -3973,6 +3973,23 @@ gckHARDWARE_SetPowerManagementState(
** if lock holder call gckCOMMAND_Stall() */
gcmkONERROR(gcvSTATUS_INVALID_REQUEST);
}
+#if gcdPOWEROFF_TIMEOUT
+ else if(State == gcvPOWER_OFF && timeout == gcvTRUE)
+ {
+ /*
+ ** try to aqcuire the mutex with more milliseconds,
+ ** flush_delayed_work should be running with timeout,
+ ** so waiting here will cause deadlock */
+ status = gckOS_AcquireMutex(os, Hardware->powerMutex, gcdPOWEROFF_TIMEOUT);
+
+ if (status == gcvSTATUS_TIMEOUT)
+ {
+ gckOS_Print("GPU Timer deadlock, exit by timeout!!!!\n");
+
+ gcmkONERROR(gcvSTATUS_INVALID_REQUEST);
+ }
+ }
+#endif
else
{
/* Acquire the power mutex. */
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 1afd1332eae5..b7717fca0ec6 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
@@ -8432,7 +8432,17 @@ gckOS_StartTimer(
if (unlikely(delayed_work_pending(&timer->work)))
{
- cancel_delayed_work(&timer->work);
+ if (unlikely(!cancel_delayed_work(&timer->work)))
+ {
+ cancel_work_sync(&timer->work.work);
+
+ if (unlikely(delayed_work_pending(&timer->work)))
+ {
+ gckOS_Print("gckOS_StartTimer error, the pending worker cannot complete!!!! \n");
+
+ return gcvSTATUS_INVALID_REQUEST;
+ }
+ }
}
queue_delayed_work(Os->workqueue, &timer->work, msecs_to_jiffies(Delay));