]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider
authorDmitry Osipenko <digetx@gmail.com>
Thu, 11 Apr 2019 21:48:34 +0000 (00:48 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 23 Sep 2019 20:11:51 +0000 (21:11 +0100)
commit 40db569d6769ffa3864fd1b89616b1a7323568a8 upstream.

There are wrongly set parenthesis in the code that are resulting in a
wrong configuration being programmed for PLLM. The original fix was made
by Danny Huang in the downstream kernel. The patch was tested on Nyan Big
Tegra124 chromebook, PLLM rate changing works correctly now and system
doesn't lock up after changing the PLLM rate due to EMC scaling.

Tested-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/clk/tegra/clk-pll.c

index 637b62ccc91e7663e792d2e665f991e311be2831..529967c0ee4a487eede8b06c612972c2eb013d64 100644 (file)
@@ -486,8 +486,8 @@ static void _update_pll_mnp(struct tegra_clk_pll *pll,
                pll_override_writel(val, params->pmc_divp_reg, pll);
 
                val = pll_override_readl(params->pmc_divnm_reg, pll);
-               val &= ~(divm_mask(pll) << div_nmp->override_divm_shift) |
-                       ~(divn_mask(pll) << div_nmp->override_divn_shift);
+               val &= ~((divm_mask(pll) << div_nmp->override_divm_shift) |
+                       (divn_mask(pll) << div_nmp->override_divn_shift));
                val |= (cfg->m << div_nmp->override_divm_shift) |
                        (cfg->n << div_nmp->override_divn_shift);
                pll_override_writel(val, params->pmc_divnm_reg, pll);