summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaniya Das <tdas@codeaurora.org>2017-03-01 23:28:24 +0530
committerTaniya Das <tdas@codeaurora.org>2017-03-02 09:12:56 +0530
commit9e172a39e1d648f48f47f2e640bb4ffc522ec1be (patch)
tree22528a6d93ff4741874ff2468bd8b1a331e63806
parenteee829e625416a38a8066524a0f6cac3b0c9d55b (diff)
clk: qcom: Use the saved current frequency for enable_safe_config
A clk_get_rate in the clk_enable path would result in a BUG from sleeping context, as clk_get_rate would hold a mutex when we have already acquired a spinlock in the clk_enable. Change-Id: I7b32292710bbea3565cdc51c79916fddc60f8bba Signed-off-by: Taniya Das <tdas@codeaurora.org>
-rw-r--r--drivers/clk/qcom/clk-rcg2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
index 9e5c0b6f7a0e..c9ba7f97eebe 100644
--- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c
@@ -513,7 +513,7 @@ static int clk_rcg2_enable(struct clk_hw *hw)
* is always on while APPS is online. Therefore, the RCG can safely be
* switched.
*/
- rate = clk_get_rate(hw->clk);
+ rate = rcg->current_freq;
f = qcom_find_freq(rcg->freq_tbl, rate);
if (!f)
return -EINVAL;
@@ -627,6 +627,9 @@ static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate)
rcg->new_index, false);
}
+ /* Update current frequency with the frequency requested. */
+ rcg->current_freq = rate;
+
return ret;
}