Skip to content

Commit 7808638

Browse files
digetxthierryreding
authored andcommitted
clk: tegra: Don't allow zero clock rate for PLLs
Zero clock rate doesn't make sense for PLLs and tegra-clk driver enters into infinite loop on trying to calculate PLL parameters for zero rate. Make code to error out if requested rate is zero. Originally this trouble was found by Robert Yang while he was trying to bring up upstream kernel on Samsung Galaxy Tab, which happened due to a bug in Tegra DRM driver that erroneously sets PLL rate to zero. This issues came over again recently during of kernel bring up on ASUS TF700T. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 18a6a71 commit 7808638

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/clk/tegra/clk-pll.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ static int _calc_rate(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
558558
u32 p_div = 0;
559559
int ret;
560560

561+
if (!rate)
562+
return -EINVAL;
563+
561564
switch (parent_rate) {
562565
case 12000000:
563566
case 26000000:

0 commit comments

Comments
 (0)