aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/tegra
diff options
context:
space:
mode:
authorAndrew Bresticker <abrestic@chromium.org>2016-01-14 14:24:34 -0500
committerThierry Reding <treding@nvidia.com>2016-02-02 09:49:23 -0500
commit3eb61566a6efc5a56ebe1e6b86519bc5e0b39003 (patch)
tree5eec5fb563219b1503d9c04ff06a88eff47ba6c1 /drivers/clk/tegra
parent736971bed20de137db9b418cc641c7d11336fffb (diff)
clk: tegra: pll: Fix potential sleeping-while-atomic
Since the ->enable() callback is called with a spinlock held, we cannot call potentially blocking functions such as clk_get_rate() or clk_get_parent(), so use the unlocked versions instead. Signed-off-by: Andrew Bresticker <abrestic@chromium.org> [rklein: Adapted from ChromeOS patch, removing pllu_enable cleanup as it isn't present upstream] Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/clk/tegra')
-rw-r--r--drivers/clk/tegra/clk-pll.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
index a534bfab30b3..65156486889a 100644
--- a/drivers/clk/tegra/clk-pll.c
+++ b/drivers/clk/tegra/clk-pll.c
@@ -880,7 +880,7 @@ static int clk_plle_training(struct tegra_clk_pll *pll)
880static int clk_plle_enable(struct clk_hw *hw) 880static int clk_plle_enable(struct clk_hw *hw)
881{ 881{
882 struct tegra_clk_pll *pll = to_clk_pll(hw); 882 struct tegra_clk_pll *pll = to_clk_pll(hw);
883 unsigned long input_rate = clk_get_rate(clk_get_parent(hw->clk)); 883 unsigned long input_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
884 struct tegra_clk_pll_freq_table sel; 884 struct tegra_clk_pll_freq_table sel;
885 u32 val; 885 u32 val;
886 int err; 886 int err;
@@ -1378,7 +1378,7 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
1378 u32 val; 1378 u32 val;
1379 int ret; 1379 int ret;
1380 unsigned long flags = 0; 1380 unsigned long flags = 0;
1381 unsigned long input_rate = clk_get_rate(clk_get_parent(hw->clk)); 1381 unsigned long input_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
1382 1382
1383 if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate)) 1383 if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate))
1384 return -EINVAL; 1384 return -EINVAL;
@@ -2014,7 +2014,7 @@ static int clk_plle_tegra210_enable(struct clk_hw *hw)
2014 u32 val; 2014 u32 val;
2015 int ret; 2015 int ret;
2016 unsigned long flags = 0; 2016 unsigned long flags = 0;
2017 unsigned long input_rate = clk_get_rate(clk_get_parent(hw->clk)); 2017 unsigned long input_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
2018 2018
2019 if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate)) 2019 if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate))
2020 return -EINVAL; 2020 return -EINVAL;