Skip to content

Commit a719604

Browse files
digetxthierryreding
authored andcommitted
clk: tegra: Ensure that PLLU configuration is applied properly
The PLLU (USB) consists of the PLL configuration itself and configuration of the PLLU outputs. The PLLU programming is inconsistent on T30 vs T114, where T114 immediately bails out if PLLU is enabled and T30 re-enables a potentially already enabled PLL (left after bootloader) and then fully reprograms it, which could be unsafe to do. The correct way should be to skip enabling of the PLL if it's already enabled and then apply configuration to the outputs. This patch doesn't fix any known problems, it's a minor improvement. Acked-by: Thierry Reding <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent c592c8a commit a719604

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/clk/tegra/clk-pll.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,8 @@ static int clk_pllu_enable(struct clk_hw *hw)
11311131
if (pll->lock)
11321132
spin_lock_irqsave(pll->lock, flags);
11331133

1134-
_clk_pll_enable(hw);
1134+
if (!clk_pll_is_enabled(hw))
1135+
_clk_pll_enable(hw);
11351136

11361137
ret = clk_pll_wait_for_lock(pll);
11371138
if (ret < 0)
@@ -1748,15 +1749,13 @@ static int clk_pllu_tegra114_enable(struct clk_hw *hw)
17481749
return -EINVAL;
17491750
}
17501751

1751-
if (clk_pll_is_enabled(hw))
1752-
return 0;
1753-
17541752
input_rate = clk_hw_get_rate(__clk_get_hw(osc));
17551753

17561754
if (pll->lock)
17571755
spin_lock_irqsave(pll->lock, flags);
17581756

1759-
_clk_pll_enable(hw);
1757+
if (!clk_pll_is_enabled(hw))
1758+
_clk_pll_enable(hw);
17601759

17611760
ret = clk_pll_wait_for_lock(pll);
17621761
if (ret < 0)

0 commit comments

Comments
 (0)