Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b897e97 authored by Vineet Bajaj's avatar Vineet Bajaj
Browse files

msm: mdss: fix race condition of DSI off and status check.



fb_event_callback cancels the work queue when it receives
the power down event. However, this event occurs after the
panel & DSI have been turned off. So if the check_status
function was being called right when the panel is being
turned off, we have a race conditon. Hence add offlock
mutex to ensure that bta status check is done when dsi
is being turned off.

Change-Id: Ie341c002c4544376bda2940fa65c6eb13997ae17
Signed-off-by: default avatarVineet Bajaj <vbajaj@codeaurora.org>
parent d81481d4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ void mdss_check_dsi_ctrl_status(struct work_struct *work, uint32_t interval)
		return;
	}

	mutex_lock(&ctrl_pdata->mutex);
	if (ctl->shared_lock)
		mutex_lock(ctl->shared_lock);
	mutex_lock(&mdp5_data->ov_lock);
@@ -73,6 +74,7 @@ void mdss_check_dsi_ctrl_status(struct work_struct *work, uint32_t interval)
		mutex_unlock(&mdp5_data->ov_lock);
		if (ctl->shared_lock)
			mutex_unlock(ctl->shared_lock);
		mutex_unlock(&ctrl_pdata->mutex);
		pr_err("%s: DSI turning off, avoiding panel status check\n",
							__func__);
		return;
@@ -100,6 +102,7 @@ void mdss_check_dsi_ctrl_status(struct work_struct *work, uint32_t interval)
	mutex_unlock(&mdp5_data->ov_lock);
	if (ctl->shared_lock)
		mutex_unlock(ctl->shared_lock);
	mutex_unlock(&ctrl_pdata->mutex);

	if ((pstatus_data->mfd->panel_power_on)) {
		if (ret > 0) {
+3 −0
Original line number Diff line number Diff line
@@ -375,6 +375,7 @@ static int mdss_dsi_off(struct mdss_panel_data *pdata)
	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\n", __func__,
				ctrl_pdata, ctrl_pdata->ndx);
@@ -392,6 +393,7 @@ static int mdss_dsi_off(struct mdss_panel_data *pdata)

	ret = mdss_dsi_panel_power_on(pdata, 0);
	if (ret) {
		mutex_unlock(&ctrl_pdata->mutex);
		pr_err("%s: Panel power off failed\n", __func__);
		return ret;
	}
@@ -401,6 +403,7 @@ static int mdss_dsi_off(struct mdss_panel_data *pdata)
	    && (panel_info->new_fps != panel_info->mipi.frame_rate))
		panel_info->mipi.frame_rate = panel_info->new_fps;

	mutex_unlock(&ctrl_pdata->mutex);
	pr_debug("%s-:\n", __func__);

	return ret;