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

Commit 8dc238dd authored by Terence Hampson's avatar Terence Hampson
Browse files

mdss: mdp3: verify return value from iommu and bw calls



When driver was enabling/disabling iommu it was not verifying
return values of the call. Same with bw set quota call.

Change-Id: I8755335bffd5d52720f8a5d735427b5306eab512
Signed-off-by: default avatarTerence Hampson <thampson@codeaurora.org>
parent c619c290
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -363,7 +363,12 @@ int mdp3_ppp_turnon(struct msm_fb_data_type *mfd, int on_off)
		pr_err("%s: mdp3_clk_enable failed\n", __func__);
		return rc;
	}
	mdp3_bus_scale_set_quota(MDP3_CLIENT_PPP, ab, ib);
	rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_PPP, ab, ib);
	if (rc < 0) {
		mdp3_clk_enable(!on_off);
		pr_err("%s: scale_set_quota failed\n", __func__);
		return rc;
	}
	ppp_stat->bw_on = on_off;
	return 0;
}
@@ -914,10 +919,14 @@ void mdp3_free_fw_timer_func(unsigned long arg)
static void mdp3_free_bw_wq_handler(struct work_struct *work)
{
	struct msm_fb_data_type *mfd = ppp_stat->mfd;
	int rc;

	mutex_lock(&ppp_stat->config_ppp_mutex);
	if (ppp_stat->bw_on) {
		mdp3_ppp_turnon(mfd, 0);
		mdp3_iommu_disable(MDP3_CLIENT_PPP);
		rc = mdp3_iommu_disable(MDP3_CLIENT_PPP);
		if (rc < 0)
			WARN(1, "Unable to disable ppp iommu\n");
	}
	mutex_unlock(&ppp_stat->config_ppp_mutex);
}
@@ -936,8 +945,19 @@ static void mdp3_ppp_blit_wq_handler(struct work_struct *work)
	}

	if (!ppp_stat->bw_on) {
		mdp3_iommu_enable(MDP3_CLIENT_PPP);
		rc = mdp3_iommu_enable(MDP3_CLIENT_PPP);
		if (rc < 0) {
			mutex_unlock(&ppp_stat->config_ppp_mutex);
			pr_err("%s: mdp3_iommu_enable failed\n", __func__);
			return;
		}
		mdp3_ppp_turnon(mfd, 1);
		if (rc < 0) {
			mdp3_iommu_disable(MDP3_CLIENT_PPP);
			mutex_unlock(&ppp_stat->config_ppp_mutex);
			pr_err("%s: Enable ppp resources failed\n", __func__);
			return;
		}
	}
	while (req) {
		mdp3_ppp_wait_for_fence(req);