mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
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: 332122eba6 ("drm: adp: Add Apple Display Pipe driver")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Janne Grunau <j@jannau.net>
Link: https://lore.kernel.org/r/20250428-drm_adp_fixes-v2-1-912e081e55d8@jannau.net
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
parent
5b1834d620
commit
bc43f7114a
|
|
@ -310,6 +310,7 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
|
|||
struct drm_atomic_state *state)
|
||||
{
|
||||
u32 frame_num = 1;
|
||||
unsigned long flags;
|
||||
struct adp_drv_private *adp = crtc_to_adp(crtc);
|
||||
struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc);
|
||||
u64 new_size = ALIGN(new_state->mode.hdisplay *
|
||||
|
|
@ -330,13 +331,13 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
|
|||
}
|
||||
writel(ADBE_FIFO_SYNC | frame_num, adp->be + ADBE_FIFO);
|
||||
//FIXME: use adbe flush interrupt
|
||||
spin_lock_irq(&crtc->dev->event_lock);
|
||||
spin_lock_irqsave(&crtc->dev->event_lock, flags);
|
||||
if (crtc->state->event) {
|
||||
drm_crtc_vblank_get(crtc);
|
||||
adp->event = crtc->state->event;
|
||||
}
|
||||
crtc->state->event = NULL;
|
||||
spin_unlock_irq(&crtc->dev->event_lock);
|
||||
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
|
||||
}
|
||||
|
||||
static const struct drm_crtc_funcs adp_crtc_funcs = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user