msm: mdss: Synchronize DSI off, BTA status and DSI event handler

Currently there will not be a race condition with ESD check and
dsi off sequences. But there can be a race condition with dsi_off
and DSI event handler as the mutex is removed from dsi_off. Add
the mutex back again in dsi_off and BTA status check.

Change-Id: I1ae6cccbcf255f5295d1fdb79de140d5615b45ad
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
This commit is contained in:
Jayant Shekhar 2015-01-30 11:29:07 +05:30 committed by David Keitel
parent 0bc9cc98ea
commit 30b06c97b9
2 changed files with 5 additions and 0 deletions

View file

@ -148,6 +148,7 @@ 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);
mutex_lock(&ctl->offlock);
if (mipi->mode == DSI_CMD_MODE)
mutex_lock(&mdp5_data->ov_lock);
@ -157,6 +158,7 @@ void mdss_check_dsi_ctrl_status(struct work_struct *work, uint32_t interval)
if (mipi->mode == DSI_CMD_MODE)
mutex_unlock(&mdp5_data->ov_lock);
mutex_unlock(&ctl->offlock);
mutex_unlock(&ctrl_pdata->mutex);
pr_err("%s: DSI turning off, avoiding panel status check\n",
__func__);
return;
@ -184,6 +186,7 @@ void mdss_check_dsi_ctrl_status(struct work_struct *work, uint32_t interval)
if (mipi->mode == DSI_CMD_MODE)
mutex_unlock(&mdp5_data->ov_lock);
mutex_unlock(&ctl->offlock);
mutex_unlock(&ctrl_pdata->mutex);
if ((pstatus_data->mfd->panel_power_state == MDSS_PANEL_POWER_ON)) {
if (ret > 0)

View file

@ -548,6 +548,7 @@ static int mdss_dsi_off(struct mdss_panel_data *pdata, int power_state)
ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
panel_data);
mutex_lock(&ctrl_pdata->mutex);
panel_info = &ctrl_pdata->panel_data.panel_info;
pr_debug("%s+: ctrl=%p ndx=%d power_state=%d\n",
@ -590,6 +591,7 @@ panel_power_ctrl:
panel_info->mipi.frame_rate = panel_info->new_fps;
end:
mutex_unlock(&ctrl_pdata->mutex);
pr_debug("%s-:\n", __func__);
return ret;