浏览代码

disp: msm: sde: update vblank notify to use spin_lock_irqsave

If the event thread worker processing vblank_notify_work is
scheduled out while holding spinlock to process the ctl-done
interrupt, it will result in a deadlock as the
frame_event_callback requires the same spinlock.

This change updates vblank notify work to use spin lock irqsave &
irqrestore to ensure we don't hit this case.

Change-Id: I96bcb3b21bf9426016f5b3ae43f7d1f8581a8483
Signed-off-by: Nilaan Gunabalachandran <[email protected]>
Nilaan Gunabalachandran 2 年之前
父节点
当前提交
6860fee2c8
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      msm/sde/sde_crtc.c

+ 3 - 2
msm/sde/sde_crtc.c

@@ -3025,6 +3025,7 @@ static void sde_crtc_vblank_notify_work(struct kthread_work *work)
 	struct sde_crtc *sde_crtc;
 	struct sde_crtc_vblank_event *vevent = container_of(work,
 					struct sde_crtc_vblank_event, work);
+	unsigned long flags;
 
 	if (!vevent->crtc) {
 		SDE_ERROR("invalid crtc\n");
@@ -3036,9 +3037,9 @@ static void sde_crtc_vblank_notify_work(struct kthread_work *work)
 
 	sde_crtc_vblank_notify(vevent->crtc, vevent->ts);
 
-	spin_lock(&sde_crtc->event_spin_lock);
+	spin_lock_irqsave(&sde_crtc->event_spin_lock, flags);
 	list_add_tail(&vevent->list, &sde_crtc->vblank_event_list);
-	spin_unlock(&sde_crtc->event_spin_lock);
+	spin_unlock_irqrestore(&sde_crtc->event_spin_lock, flags);
 }
 
 static void sde_crtc_vblank_cb(void *data, ktime_t ts)