Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e55cd14c authored by Sandeep Panda's avatar Sandeep Panda
Browse files

drm/msm/sde: avoid dead lock in missing TE recovery sequence



In the current implementation if there is no TE coming from
display panel, then ESD recovery kicks in to reset display HW.
In the ESD recovery path driver puts vote for HW resources by
queuing a work in the commit thread, to avoid unclocked access
to SDE registers and then waits for work to finish. But if the
recovery process is triggered by commit thread itself, then it
will lead to deadlock. Hence avoid this scenario by checking
for thread id before putting the vote.

Change-Id: Ia03d95d929215ef4f23f6de11ebabeef5f66d9e3
Signed-off-by: default avatarSandeep Panda <spanda@codeaurora.org>
parent a385b633
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -4858,10 +4858,14 @@ int sde_encoder_display_failure_notification(struct drm_encoder *enc)
	SDE_EVT32_VERBOSE(DRMID(enc));

	disp_thread = &priv->disp_thread[sde_enc->crtc->index];

	if (current->tgid == disp_thread->thread->tgid) {
		sde_encoder_resource_control(&sde_enc->base,
					     SDE_ENC_RC_EVENT_KICKOFF);
	} else {
		kthread_queue_work(&disp_thread->worker,
				   &sde_enc->esd_trigger_work);
		kthread_flush_work(&sde_enc->esd_trigger_work);
	}
	/**
	 * panel may stop generating te signal (vsync) during esd failure. rsc
	 * hardware may hang without vsync. Avoid rsc hang by generating the
+0 −4
Original line number Diff line number Diff line
@@ -242,10 +242,6 @@ int sde_encoder_update_caps_for_cont_splash(struct drm_encoder *encoder);
 * esd timeout or other display failure notification. This event flows from
 * dsi, sde_connector to sde_encoder.
 *
 * This api must not be called from crtc_commit (display) thread because it
 * requests the flush work on same thread. It is called from esd check thread
 * based on current design.
 *
 *      TODO: manage the event at sde_kms level for forward processing.
 * @drm_enc:    Pointer to drm encoder structure
 * @Return:     true if successful in updating the encoder structure