msm: mdss: fix req availability check in dsi command commit

NULL check for req in dsi cmd list commit is misplaced, causing
race condition due to skipping of dsi cmd mdp busy check. This would
eventually result in underflow due to possible contention of using dsi
link. Fix the NULL check to avoid misbehavior.

Change-Id: I5999646d4db67efd0854b3db07e1d987e66c9cb5
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
This commit is contained in:
Veera Sundaram Sankaran 2015-06-04 12:52:30 -07:00 committed by David Keitel
parent ec458f6feb
commit a60d7c6ad3

View file

@ -2059,6 +2059,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
struct mdss_rect *roi = NULL;
int ret = -EINVAL;
int rc = 0;
bool hs_req = false;
if (mdss_get_sd_client_cnt())
return -EPERM;
@ -2075,8 +2076,8 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
MDSS_XLOG(ctrl->ndx, from_mdp, ctrl->mdp_busy, current->pid,
XLOG_FUNC_ENTRY);
if (req == NULL)
goto need_lock;
if (req && (req->flags & CMD_REQ_HS_MODE))
hs_req = true;
/* make sure dsi_cmd_mdp is idle */
mdss_dsi_cmd_mdp_busy(ctrl);
@ -2098,11 +2099,13 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
}
} else { /* from dcs send */
if (ctrl->shared_data->cmd_clk_ln_recovery_en &&
ctrl->panel_mode == DSI_CMD_MODE &&
(req->flags & CMD_REQ_HS_MODE))
ctrl->panel_mode == DSI_CMD_MODE && hs_req)
mdss_dsi_cmd_start_hs_clk_lane(ctrl);
}
if (!req)
goto need_lock;
MDSS_XLOG(ctrl->ndx, req->flags, req->cmds_cnt, from_mdp, current->pid);
/*