From 6c8c0f62d3ced4b8bb812a6fbe13cfa1902718f5 Mon Sep 17 00:00:00 2001 From: Ray Zhang Date: Mon, 18 Jan 2016 15:31:25 +0800 Subject: [PATCH] msm: mdss: fix deadlock between display and ESD check thread Display thread holds ov_lock followed by mutex, while the ESD check thread for cmd mode panel holds mutex followed by ov_lock. Fix this deadlock by acquiring mutex before ov_lock in ESD check thread. Change-Id: I857f780e14a6ccb679e89ff16b19706d205df4b6 Signed-off-by: Ray Zhang --- drivers/video/fbdev/msm/dsi_status_6g.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/msm/dsi_status_6g.c b/drivers/video/fbdev/msm/dsi_status_6g.c index bec6818e95a5..c711dfa22071 100644 --- a/drivers/video/fbdev/msm/dsi_status_6g.c +++ b/drivers/video/fbdev/msm/dsi_status_6g.c @@ -125,17 +125,17 @@ void mdss_check_dsi_ctrl_status(struct work_struct *work, uint32_t interval) * overlay operations. Need refine this lock for command mode */ - mutex_lock(&ctrl_pdata->mutex); if (mipi->mode == DSI_CMD_MODE) mutex_lock(&mdp5_data->ov_lock); mutex_lock(&ctl->offlock); + mutex_lock(&ctrl_pdata->mutex); if (mdss_panel_is_power_off(pstatus_data->mfd->panel_power_state) || pstatus_data->mfd->shutdown_pending) { + mutex_unlock(&ctrl_pdata->mutex); mutex_unlock(&ctl->offlock); if (mipi->mode == DSI_CMD_MODE) mutex_unlock(&mdp5_data->ov_lock); - mutex_unlock(&ctrl_pdata->mutex); pr_err("%s: DSI turning off, avoiding panel status check\n", __func__); return; @@ -160,10 +160,10 @@ void mdss_check_dsi_ctrl_status(struct work_struct *work, uint32_t interval) ret = ctrl_pdata->check_status(ctrl_pdata); mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); + mutex_unlock(&ctrl_pdata->mutex); mutex_unlock(&ctl->offlock); if (mipi->mode == DSI_CMD_MODE) mutex_unlock(&mdp5_data->ov_lock); - mutex_unlock(&ctrl_pdata->mutex); if ((pstatus_data->mfd->panel_power_state == MDSS_PANEL_POWER_ON)) { if (ret > 0) -- 2.11.0