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

Commit 936185ee authored by Xu,Baochu's avatar Xu,Baochu
Browse files

msm: mdss: fix NOC error issue on mdss-pll



mdss-pll register may be accessed when mdss-pll is not enabled.
It is caused by a race condition.
This change is to add a mutex to avoid race condition.

Change-Id: I3b53fd9be55f8de6c234222fe28eba5da2819713
Signed-off-by: default avatarXu,Baochu <bxu@codeaurora.org>
parent becfd28d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -44,6 +44,7 @@ int mdss_pll_resource_enable(struct mdss_pll_resources *pll_res, bool enable)
		return rc;
	}

	mutex_lock(&pll_res->mutex);
	if (enable) {
		if (pll_res->resource_ref_cnt == 0)
			changed++;
@@ -65,6 +66,7 @@ int mdss_pll_resource_enable(struct mdss_pll_resources *pll_res, bool enable)
		else
			pll_res->resource_enable = enable;
	}
	mutex_unlock(&pll_res->mutex);

	return rc;
}
@@ -334,6 +336,7 @@ static int mdss_pll_probe(struct platform_device *pdev)
		goto gdsc_io_error;
	}

	mutex_init(&pll_res->mutex);
	rc = mdss_pll_resource_init(pdev, pll_res);
	if (rc) {
		pr_err("Pll ndx=%d resource init failed rc=%d\n",
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -183,6 +183,8 @@ struct mdss_pll_resources {
	 */
	struct dfps_info *dfps;

	struct mutex mutex;

};

struct mdss_pll_vco_calc {