Skip to content

Commit be03b30

Browse files
Fei ShaoChun-Kuang Hu
authored andcommitted
drm/mediatek: Use spin_lock_irqsave() for CRTC event lock
Use the state-aware spin_lock_irqsave() and spin_unlock_irqrestore() to avoid unconditionally re-enabling the local interrupts. Fixes: 411f5c1 ("drm/mediatek: handle events when enabling/disabling crtc") Signed-off-by: Fei Shao <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent fe30bae commit be03b30

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/mediatek/mtk_crtc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_crtc *mtk_crtc)
429429
{
430430
struct drm_device *drm = mtk_crtc->base.dev;
431431
struct drm_crtc *crtc = &mtk_crtc->base;
432+
unsigned long flags;
432433
int i;
433434

434435
for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) {
@@ -460,10 +461,10 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_crtc *mtk_crtc)
460461
pm_runtime_put(drm->dev);
461462

462463
if (crtc->state->event && !crtc->state->active) {
463-
spin_lock_irq(&crtc->dev->event_lock);
464+
spin_lock_irqsave(&crtc->dev->event_lock, flags);
464465
drm_crtc_send_vblank_event(crtc, crtc->state->event);
465466
crtc->state->event = NULL;
466-
spin_unlock_irq(&crtc->dev->event_lock);
467+
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
467468
}
468469
}
469470

0 commit comments

Comments
 (0)