From 08d04c2f3bae17ce9863a6f66044ac0cecfa5394 Mon Sep 17 00:00:00 2001 From: Mahadevan Date: Wed, 20 Jan 2021 17:54:49 +0530 Subject: [PATCH] disp: msm: sde: avoid rc restart when triggered from panel dead This change prevents scheduling of rc_restart in case of panel dead. This early return is required to avoid the list add corruption when a race condition happens between event thread and commit thread. When event thread is handling display failure notification if the virt_enable arrives in commit thread it will reinizialize kthread for delayed_off_work without deactivating the existing list which leads to linkage corruption. Change-Id: I41d08cd47ba6f887f0860e52bcddf414085524bb Signed-off-by: Mahadevan --- msm/sde/sde_encoder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/msm/sde/sde_encoder.c b/msm/sde/sde_encoder.c index 0fca0a2910c0..5b07b7be1561 100644 --- a/msm/sde/sde_encoder.c +++ b/msm/sde/sde_encoder.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. * Copyright (C) 2013 Red Hat * Author: Rob Clark * @@ -1626,6 +1626,10 @@ static void _sde_encoder_rc_restart_delayed(struct sde_encoder_virt *sde_enc, unsigned int lp, idle_pc_duration; struct msm_drm_thread *disp_thread; + /* return early if called from esd thread */ + if (!sde_enc->delay_kickoff) + return; + /* set idle timeout based on master connector's lp value */ if (sde_enc->cur_master) lp = sde_connector_get_lp(