From e2c7c934b3eb3da099bd358fa205c3b139e48df1 Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Thu, 12 Jan 2017 09:33:49 +0800 Subject: [PATCH] drm/rockchip: vop: wait for completion with timeout Wait for completion forever is very dangerous, make system die is very bad. Change-Id: Ib447b9bbf3564b5107b33edec331d4925241fc45 Signed-off-by: Mark Yao --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index f75e02570e4e..959417b9c8ce 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -862,7 +862,8 @@ static void vop_crtc_disable(struct drm_crtc *crtc) spin_unlock(&vop->reg_lock); - wait_for_completion(&vop->dsp_hold_completion); + WARN_ON(!wait_for_completion_timeout(&vop->dsp_hold_completion, + msecs_to_jiffies(50))); vop_dsp_hold_valid_irq_disable(vop); @@ -1463,7 +1464,8 @@ static void vop_crtc_enable(struct drm_crtc *crtc) spin_unlock(&vop->reg_lock); - wait_for_completion(&vop->dsp_hold_completion); + WARN_ON(!wait_for_completion_timeout(&vop->dsp_hold_completion, + msecs_to_jiffies(50))); vop_dsp_hold_valid_irq_disable(vop); } -- 2.34.1