disp: msm: dsi: add missing dsi ctrl mutex lock in host timing update

Acquire dsi_ctrl->ctrl_lock lock before programming dsi ctrl
registers. Failing this may lead to race conditions in register
programming.
Add missing mutex lock inside dsi_ctrl_host_timing_update().

Change-Id: Ic86cbe282333c0b4d63ae3d5b3356a5d24752203
Signed-off-by: Rajeev Nandan <quic_rajeevny@quicinc.com>
This commit is contained in:
Rajeev Nandan
2022-05-05 15:13:17 +05:30
committed by Gerrit - the friendly Code Review server
parent 0c0cf5f2ca
commit d26a3a480e

View File

@@ -3017,6 +3017,8 @@ int dsi_ctrl_host_timing_update(struct dsi_ctrl *dsi_ctrl)
return -EINVAL;
}
mutex_lock(&dsi_ctrl->ctrl_lock);
if (dsi_ctrl->hw.ops.host_setup)
dsi_ctrl->hw.ops.host_setup(&dsi_ctrl->hw,
&dsi_ctrl->host_config.common_config);
@@ -3034,9 +3036,11 @@ int dsi_ctrl_host_timing_update(struct dsi_ctrl *dsi_ctrl)
0x0, NULL);
} else {
DSI_CTRL_ERR(dsi_ctrl, "invalid panel mode for resolution switch\n");
mutex_unlock(&dsi_ctrl->ctrl_lock);
return -EINVAL;
}
mutex_unlock(&dsi_ctrl->ctrl_lock);
return 0;
}