From d6bc431a146faf6fbe75561106e7bbe0cfcda022 Mon Sep 17 00:00:00 2001 From: Padmanabhan Komanduru Date: Wed, 18 Feb 2015 21:25:12 +0530 Subject: [PATCH] msm: mdss: synchronize DSI overflow recovery thread with suspend/shutdown DSI overflow recovery thread has synchronization issues with suspend and FB shutdown path causing watchdog bark issues due to excessive logging and NOC errors due to unclocked register access. Add changes to synchronize the thread properly. Change-Id: I9e6c4d21803d1bb99349568ac2cca431d5a5d1c3 Signed-off-by: Padmanabhan Komanduru --- drivers/video/fbdev/msm/mdss_mdp_intf_video.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c index 69552648dfaa..0c4973a8750b 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c +++ b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c @@ -191,9 +191,12 @@ static void mdss_mdp_video_intf_recovery(void *data, int event) if (delay > POLL_TIME_USEC_FOR_LN_CNT) delay = POLL_TIME_USEC_FOR_LN_CNT; + mutex_lock(&ctl->offlock); while (1) { - if (!ctl || !ctx || !ctx->timegen_en) { - pr_warn("Target is in suspend state\n"); + if (!ctl || ctl->mfd->shutdown_pending || !ctx || + !ctx->timegen_en) { + pr_warn("Target is in suspend or shutdown pending\n"); + mutex_unlock(&ctl->offlock); return; } @@ -203,6 +206,7 @@ static void mdss_mdp_video_intf_recovery(void *data, int event) (active_lns_cnt + min_ln_cnt))) { pr_debug("%s, Needed lines left line_cnt=%d\n", __func__, line_cnt); + mutex_unlock(&ctl->offlock); return; } else { pr_warn("line count is less. line_cnt = %d\n",