From: Mark Yao Date: Thu, 12 Jan 2017 01:33:49 +0000 (+0800) Subject: drm/rockchip: vop: wait for completion with timeout X-Git-Tag: firefly_0821_release~758 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e2c7c934b3eb3da099bd358fa205c3b139e48df1;p=firefly-linux-kernel-4.4.55.git 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 --- 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); }