Skip to content

Commit bc43f71

Browse files
jannaualyssarosenzweig
authored andcommitted
drm: adp: Use spin_lock_irqsave for drm device event_lock
The lock is used in the interrupt handler so use spin_lock_irqsave to disable interrupts and avoid deadlocks with the irq handler. Fixes: 332122e ("drm: adp: Add Apple Display Pipe driver") Reviewed-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Janne Grunau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alyssa Rosenzweig <[email protected]>
1 parent 5b1834d commit bc43f71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/adp/adp_drv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
310310
struct drm_atomic_state *state)
311311
{
312312
u32 frame_num = 1;
313+
unsigned long flags;
313314
struct adp_drv_private *adp = crtc_to_adp(crtc);
314315
struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc);
315316
u64 new_size = ALIGN(new_state->mode.hdisplay *
@@ -330,13 +331,13 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
330331
}
331332
writel(ADBE_FIFO_SYNC | frame_num, adp->be + ADBE_FIFO);
332333
//FIXME: use adbe flush interrupt
333-
spin_lock_irq(&crtc->dev->event_lock);
334+
spin_lock_irqsave(&crtc->dev->event_lock, flags);
334335
if (crtc->state->event) {
335336
drm_crtc_vblank_get(crtc);
336337
adp->event = crtc->state->event;
337338
}
338339
crtc->state->event = NULL;
339-
spin_unlock_irq(&crtc->dev->event_lock);
340+
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
340341
}
341342

342343
static const struct drm_crtc_funcs adp_crtc_funcs = {

0 commit comments

Comments
 (0)