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

Commit 8d57f083 authored by Lei Chen's avatar Lei Chen Committed by Jayaprakash Madisetty
Browse files

disp: msm: sde: cancel delayed_off_work before reinitialization



Canceling delayed_off_work in encoder pre_modeset might not be
executed in all cases, but the following encoder enable might
initialize the work.

This will lead to list corruption as delayed_off work list node
is reinitialized before removing from linked list.
Move canceling delayed_off_work to start of encoder mode_set to
ensure work is canceled before reinitialization.

Change-Id: I38687604f2eedced308ea02019c162022725534e
Signed-off-by: default avatarLei Chen <quic_chenlei@quicinc.com>
Signed-off-by: default avatarJayaprakash Madisetty <quic_jmadiset@quicinc.com>
parent c5ff99c3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1842,9 +1842,6 @@ static int _sde_encoder_rc_pre_modeset(struct drm_encoder *drm_enc,
{
	int ret = 0;

	/* cancel delayed off work, if any */
	_sde_encoder_rc_cancel_delayed(sde_enc, sw_event);

	mutex_lock(&sde_enc->rc_lock);

	if (sde_enc->rc_state == SDE_ENC_RC_STATE_OFF) {
@@ -2371,6 +2368,9 @@ static void sde_encoder_virt_mode_set(struct drm_encoder *drm_enc,
	sde_connector_state_get_mode_info(conn->state, &sde_enc->mode_info);
	sde_encoder_dce_set_bpp(sde_enc->mode_info, sde_enc->crtc);

	/* cancel delayed off work, if any */
	kthread_cancel_delayed_work_sync(&sde_enc->delayed_off_work);

	/* release resources before seamless mode change */
	ret = sde_encoder_virt_modeset_rc(drm_enc, adj_mode, true);
	if (ret)