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

Commit a99b150e authored by Krishna Chaitanya Devarakonda's avatar Krishna Chaitanya Devarakonda
Browse files

msm: mdss: Fix race condition during secure display transitions



When we release the ov_lock in kickoff after the commit sequence,
there is a chance that validate call for the next commit updates
the secure display transition state. This might result in early
secure display configuration (enable/disable), which will cause
SMMU faults. To avoid this, store the secure display transition
state at the start of kickoff locally, and use it for secure display
configurations.

Change-Id: Ib7bfe23be30d3ee70e346e388bf112bc1d0c4e99
Signed-off-by: default avatarKrishna Chaitanya Devarakonda <kdevarak@codeaurora.org>
parent 315f8d16
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2820,6 +2820,7 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
	struct mdss_mdp_ctl *ctl = mfd_to_ctl(mfd);
	int ret = 0;
	struct mdss_mdp_commit_cb commit_cb;
	u8 sd_transition_state = 0;

	if (!ctl)
		return -ENODEV;
@@ -2863,7 +2864,8 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
	if (ctl->ops.wait_pingpong && mdp5_data->mdata->serialize_wait4pp)
		mdss_mdp_display_wait4pingpong(ctl, true);

	if (mdp5_data->sd_transition_state != SD_TRANSITION_NONE) {
	sd_transition_state = mdp5_data->sd_transition_state;
	if (sd_transition_state != SD_TRANSITION_NONE) {
		ret = __config_secure_display(mdp5_data);
		if (IS_ERR_VALUE(ret)) {
			pr_err("Secure session config failed\n");
@@ -2953,7 +2955,7 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
	 * If we are transitioning from secure to non-secure display,
	 * disable the secure display.
	 */
	if (mdp5_data->sd_enabled && (mdp5_data->sd_transition_state ==
	if (mdp5_data->sd_enabled && (sd_transition_state ==
			SD_TRANSITION_SECURE_TO_NON_SECURE)) {
		ret = mdss_mdp_secure_display_ctrl(mdp5_data->mdata, 0);
		if (!ret)