diff options
| author | Taniya Das <tdas@codeaurora.org> | 2017-01-17 15:53:08 +0530 |
|---|---|---|
| committer | Taniya Das <tdas@codeaurora.org> | 2017-01-18 08:49:36 +0530 |
| commit | 95c4b7facf11e7a81443ad598afe6294aaa28f2f (patch) | |
| tree | 4976b5fcbf028ec908ff58de2cb08dd8f64178f6 | |
| parent | a51b7f60003e6071703d5e4489dae0f3ab7ae264 (diff) | |
clk: qcom: Move prepare_enable of XO clock before spinlock
clk_prepare would hold a mutex and as clk_debug_mux_measure_rate has
already acquired a spinlock it would result in a BUG from sleeping context.
Avoid this by moving the prepare_enable before acquiring spinlock.
Change-Id: Ia405c884663ef80e87ae066df09f1c30134faf2e
Signed-off-by: Taniya Das <tdas@codeaurora.org>
| -rw-r--r-- | drivers/clk/qcom/common.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index c762a387068b..cba778b827ec 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, 2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014, 2016-2017, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -339,10 +339,11 @@ static unsigned long clk_debug_mux_measure_rate(struct clk_hw *hw) struct clk_debug_mux *meas = to_clk_measure(hw); struct measure_clk_data *data = meas->priv; - spin_lock_irqsave(&clk_reg_lock, flags); clk_prepare_enable(data->cxo); + spin_lock_irqsave(&clk_reg_lock, flags); + /* Enable CXO/4 and RINGOSC branch. */ regmap_read(meas->regmap[GCC], data->xo_div4_cbcr, &gcc_xo4_reg); gcc_xo4_reg |= BIT(0); @@ -376,10 +377,10 @@ static unsigned long clk_debug_mux_measure_rate(struct clk_hw *hw) ret = (raw_count_full * multiplier); } - clk_disable_unprepare(data->cxo); - spin_unlock_irqrestore(&clk_reg_lock, flags); + clk_disable_unprepare(data->cxo); + return ret; } |
