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

Commit 05a13ff7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "clk: msm: mdss: add locking mechanism for critical section"

parents 70cb59a5 d5d06c27
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ int mdss_pll_util_resource_init(struct platform_device *pdev,
		goto clk_err;
	}

	mutex_init(&pll_res->res_lock);
	return rc;

clk_err:
@@ -90,6 +91,8 @@ void mdss_pll_util_resource_deinit(struct platform_device *pdev,
	msm_dss_put_clk(mp->clk_config, mp->num_clk);

	msm_dss_config_vreg(&pdev->dev, mp->vreg_config, mp->num_vreg, 0);

	mutex_destroy(&pll_res->res_lock);
}

void mdss_pll_util_resource_release(struct platform_device *pdev,
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ int mdss_pll_resource_enable(struct mdss_pll_resources *pll_res, bool enable)
		return rc;
	}

	mutex_lock(&pll_res->res_lock);
	if (enable) {
		if (pll_res->resource_ref_cnt == 0)
			changed++;
@@ -67,6 +68,7 @@ int mdss_pll_resource_enable(struct mdss_pll_resources *pll_res, bool enable)
			pll_res->resource_enable = enable;
	}

	mutex_unlock(&pll_res->res_lock);
	return rc;
}

+5 −0
Original line number Diff line number Diff line
@@ -160,6 +160,11 @@ struct mdss_pll_resources {
	 */
	uint32_t index;

	/*
	 * Mutex to handle pll resource access
	 */
	struct mutex res_lock;

	struct dfps_info *dfps;
};