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

Commit 6c5b7e1b authored by Huaibin Yang's avatar Huaibin Yang Committed by Jeevan Shriram
Browse files

msm: mdss: add mutex locking when BTA is triggered



Add cmd_mutex when doing s/w triggered BTA to make sure this operation
does not race with DCS commands.

Change-Id: I888e06a8175691938aebc7a51c2c693d582ce23d
Signed-off-by: default avatarHuaibin Yang <huaibiny@codeaurora.org>
parent 533ea702
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -991,6 +991,8 @@ int mdss_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
		return 0;
	}

	mutex_lock(&ctrl_pdata->cmd_mutex);

	pr_debug("%s: Checking Register status\n", __func__);

	mdss_dsi_clk_ctrl(ctrl_pdata, DSI_ALL_CLKS, 1);
@@ -1017,6 +1019,8 @@ int mdss_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
	mdss_dsi_clk_ctrl(ctrl_pdata, DSI_ALL_CLKS, 0);
	pr_debug("%s: Read register done with ret: %d\n", __func__, ret);

	mutex_unlock(&ctrl_pdata->cmd_mutex);

	return ret;
}

@@ -1154,6 +1158,8 @@ int mdss_dsi_bta_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
		return 0;
	}

	mutex_lock(&ctrl_pdata->cmd_mutex);

	pr_debug("%s: Checking BTA status\n", __func__);

	mdss_dsi_clk_ctrl(ctrl_pdata, DSI_ALL_CLKS, 1);
@@ -1174,6 +1180,8 @@ int mdss_dsi_bta_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
	mdss_dsi_clk_ctrl(ctrl_pdata, DSI_ALL_CLKS, 0);
	pr_debug("%s: BTA done with ret: %d\n", __func__, ret);

	mutex_unlock(&ctrl_pdata->cmd_mutex);

	return ret;
}