From: Tomasz Figa Date: Thu, 8 Sep 2016 06:32:54 +0000 (+0900) Subject: CHROMIUM: drm/rockchip: Clear interrupt status bits before enabling X-Git-Tag: firefly_0821_release~1168 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b8c785afcffad096cc265b19f912b71c390f0f63;p=firefly-linux-kernel-4.4.55.git CHROMIUM: drm/rockchip: Clear interrupt status bits before enabling The enable register only masks the raw status bits to signal CPU interrupt only for enabled interrupts. The status bits are activated regardless of the enable register. This means that we might have an old interrupt event queued, which we are not interested in. To avoid getting a spurious interrupt signalled, we have to clear the old bit before we update the enable register. BUG=chrome-os-partner:56378 BUG=chrome-os-partner:56580 TEST=while true; do backlight_dbus_tool --set --percent=0 && sleep 8 && backlight_dbus_tool --set --percent=100 && sleep 3 ; done Change-Id: I1b8286097f3ba102663ee3a7566fd96492e12d26 Signed-off-by: Tomasz Figa Reviewed-on: https://chromium-review.googlesource.com/382973 Reviewed-by: Daniel Kurtz 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 b10476fca40b..a80deb50d27d 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -664,6 +664,7 @@ static void vop_dsp_hold_valid_irq_enable(struct vop *vop) spin_lock_irqsave(&vop->irq_lock, flags); + VOP_INTR_SET_TYPE(vop, clear, DSP_HOLD_VALID_INTR, 1); VOP_INTR_SET_TYPE(vop, enable, DSP_HOLD_VALID_INTR, 1); spin_unlock_irqrestore(&vop->irq_lock, flags); @@ -726,6 +727,7 @@ static void vop_line_flag_irq_enable(struct vop *vop, int line_num) spin_lock_irqsave(&vop->irq_lock, flags); VOP_INTR_SET(vop, line_flag_num[0], line_num); + VOP_INTR_SET_TYPE(vop, clear, LINE_FLAG_INTR, 1); VOP_INTR_SET_TYPE(vop, enable, LINE_FLAG_INTR, 1); spin_unlock_irqrestore(&vop->irq_lock, flags); @@ -1240,6 +1242,7 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) spin_lock_irqsave(&vop->irq_lock, flags); + VOP_INTR_SET_TYPE(vop, clear, FS_INTR, 1); VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 1); spin_unlock_irqrestore(&vop->irq_lock, flags);