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

Commit 638d2fe7 authored by Taniya Das's avatar Taniya Das Committed by David Collins
Browse files

clk: qcom: rcg2: Remove support for update_src_map



The commit 7533b7fb5495 ("clk: qcom: clk-rcg2: Read RCG source before
calculating clk rate")' had introduced a function to update the src map,
but there could be a race where a set_rate for a clock from a particular
CC on a CPU could override the global cxo_f which was set by clock
enable/disable for a clock from another CC.

Change-Id: Id86818895e226a387e7fd1a09e2034eee18fd361
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 90823f3c
Loading
Loading
Loading
Loading
+0 −28
Original line number Original line Diff line number Diff line
@@ -69,16 +69,6 @@ static struct freq_tbl cxo_f = {
	.n = 0,
	.n = 0,
};
};


static void update_src_map(struct clk_hw *hw)
{
	struct clk_rcg2 *rcg = to_clk_rcg2(hw);
	int i, num_parents = clk_hw_get_num_parents(hw);

	for (i = 0; i < num_parents; i++)
		if (!rcg->parent_map[i].cfg)
			cxo_f.src = rcg->parent_map[i].src;
}

static int clk_rcg2_is_enabled(struct clk_hw *hw)
static int clk_rcg2_is_enabled(struct clk_hw *hw)
{
{
	struct clk_rcg2 *rcg = to_clk_rcg2(hw);
	struct clk_rcg2 *rcg = to_clk_rcg2(hw);
@@ -453,12 +443,6 @@ static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate,
	if (!f)
	if (!f)
		return -EINVAL;
		return -EINVAL;


	/*
	 * Set the correct source value for CXO as per
	 * as per defined parent map.
	 */
	update_src_map(hw);

	/*
	/*
	 * Return if the RCG is currently disabled. This configuration update
	 * Return if the RCG is currently disabled. This configuration update
	 * will happen as part of the RCG enable sequence.
	 * will happen as part of the RCG enable sequence.
@@ -542,12 +526,6 @@ static int clk_rcg2_enable(struct clk_hw *hw)
	unsigned long rate;
	unsigned long rate;
	const struct freq_tbl *f;
	const struct freq_tbl *f;


	/*
	 * Set the correct source value for CXO as per
	 * as per defined parent map.
	 */
	update_src_map(hw);

	if (rcg->flags & FORCE_ENABLE_RCG) {
	if (rcg->flags & FORCE_ENABLE_RCG) {
		clk_rcg2_set_force_enable(hw);
		clk_rcg2_set_force_enable(hw);
		return 0;
		return 0;
@@ -589,12 +567,6 @@ static void clk_rcg2_disable(struct clk_hw *hw)
{
{
	struct clk_rcg2 *rcg = to_clk_rcg2(hw);
	struct clk_rcg2 *rcg = to_clk_rcg2(hw);


	/*
	 * Set the correct source value for CXO as per
	 * as per defined parent map.
	 */
	update_src_map(hw);

	if (rcg->flags & FORCE_ENABLE_RCG) {
	if (rcg->flags & FORCE_ENABLE_RCG) {
		clk_rcg2_clear_force_enable(hw);
		clk_rcg2_clear_force_enable(hw);
		return;
		return;