Skip to contentSkip to conversation

clk: Tegra124 PLLM fixes

PATCH Applied Dmitry Osipenko 3 participants 10 messages Apr 11, 2019 – Apr 25, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover clk: Tegra124 PLLM fixes

Hello, here are two trivial patches that are correcting PLLM on Tegra124. First fixes system lockup due to a bad hardware configuration, second removes usage of a non-existent register bit.

Dmitry Osipenko (2):
clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides
divider
clk: tegra124: Remove lock-enable bit from PLLM

 drivers/clk/tegra/clk-pll.c      | 4 ++--
 drivers/clk/tegra/clk-tegra124.c | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/2 clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider

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.

---
 drivers/clk/tegra/clk-pll.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/tegra/clk-pll.c +2 -2
index b50b7460014b..3e67cbcd80da 100644
@@ -663,8 +663,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);
Signature · 1 line
2.21.0
maintainer Applied
#2 lore raw

Re: [PATCH v1 1/2] clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider

Quoting Dmitry Osipenko (2019-04-11 14:48:34)

Quoted 10 lines

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.

---

Applied to clk-next

#3 lore raw

PATCH 2/2 clk: tegra124: Remove lock-enable bit from PLLM

In reply to Dmitry Osipenko

According to the Tegra124 TRM documentation, PLLM_MISC2 register doesn't have the lock-enable bit as well as any other PLLM-related register. Hence PLLM re-locking can't be initiated by software. The incorrect bit setting should have been harmless since that bit is undefined according to TRM.

---
 drivers/clk/tegra/clk-tegra124.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/tegra/clk-tegra124.c +1 -2
index df0018f7bf7e..940592375583 100644
@@ -413,7 +413,6 @@ static struct tegra_clk_pll_params pll_m_params = {
 	.base_reg = PLLM_BASE,
 	.misc_reg = PLLM_MISC,
 	.lock_mask = PLL_BASE_LOCK,
-	.lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
 	.lock_delay = 300,
 	.max_p = 5,
 	.pdiv_tohw = pllm_p,
@@ -421,7 +420,7 @@ static struct tegra_clk_pll_params pll_m_params = {
 	.pmc_divnm_reg = PMC_PLLM_WB0_OVERRIDE,
 	.pmc_divp_reg = PMC_PLLM_WB0_OVERRIDE_2,
 	.freq_table = pll_m_freq_table,
-	.flags = TEGRA_PLL_USE_LOCK | TEGRA_PLL_HAS_LOCK_ENABLE,
+	.flags = TEGRA_PLL_USE_LOCK,
 };
 
 static struct tegra_clk_pll_freq_table pll_e_freq_table[] = {
Signature · 1 line
2.21.0
maintainer Applied
#4 lore raw

Re: [PATCH v1 2/2] clk: tegra124: Remove lock-enable bit from PLLM

Quoting Dmitry Osipenko (2019-04-11 14:48:35)

Quoted 8 lines

According to the Tegra124 TRM documentation, PLLM_MISC2 register doesn't have the lock-enable bit as well as any other PLLM-related register. Hence PLLM re-locking can't be initiated by software. The incorrect bit setting should have been harmless since that bit is undefined according to TRM.

---

Applied to clk-next

#5 lore raw
In reply to Dmitry Osipenko

12.04.2019 0:48, Dmitry Osipenko пишет:

Quoted 4 lines

Hello, here are two trivial patches that are correcting PLLM on Tegra124. First fixes system lockup due to a bad hardware configuration, second removes usage of a non-existent register bit.

Quoted 9 lines

Dmitry Osipenko (2):
clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides
divider
clk: tegra124: Remove lock-enable bit from PLLM

 drivers/clk/tegra/clk-pll.c      | 4 ++--
 drivers/clk/tegra/clk-tegra124.c | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

Hello Peter,

The patches in this series are trivial and fixing the longstanding bug on Tegra124. Could you please take a look and and ACK the series if it looks good to you?

#6 lore raw
Quoted 10 lines · Dmitry Osipenko

12.04.2019 0:48, Dmitry Osipenko пишет:

Quoted 9 lines

Hello, here are two trivial patches that are correcting PLLM on Tegra124. First fixes system lockup due to a bad hardware configuration, second removes usage of a non-existent register bit.

Dmitry Osipenko (2):
clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides
divider
clk: tegra124: Remove lock-enable bit from PLLM

Quoted 8 lines
Quoted 4 lines
 drivers/clk/tegra/clk-pll.c      | 4 ++--
 drivers/clk/tegra/clk-tegra124.c | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

Hello Peter,

The patches in this series are trivial and fixing the longstanding bug on Tegra124. Could you please take a look and and ACK the series if it looks good to you?

Peter.

#7 lore raw

24.04.2019 11:36, Peter De Schrijver пишет:

Quoted 16 lines · Dmitry Osipenko
Quoted 15 lines

12.04.2019 0:48, Dmitry Osipenko пишет:

Quoted 13 lines

Hello, here are two trivial patches that are correcting PLLM on Tegra124. First fixes system lockup due to a bad hardware configuration, second removes usage of a non-existent register bit.

Dmitry Osipenko (2):
clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides
divider
clk: tegra124: Remove lock-enable bit from PLLM

 drivers/clk/tegra/clk-pll.c      | 4 ++--
 drivers/clk/tegra/clk-tegra124.c | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
Quoted 5 lines
Quoted 3 lines

Hello Peter,

The patches in this series are trivial and fixing the longstanding bug on Tegra124. Could you please take a look and and ACK the series if it looks good to you?

Thank you, Peter.

Stephen, is yours maintainer-tool able to pick up the "Acked-By" for the whole series or do I need to resend the series with a proper "Acked-by" tag added to every patch? Please let me know.

maintainer
#8 lore raw

Quoting Dmitry Osipenko (2019-04-25 06:50:39)

Quoted 4 lines

24.04.2019 11:36, Peter De Schrijver пишет:

Quoted 3 lines · Dmitry Osipenko
Quoted 2 lines

12.04.2019 0:48, Dmitry Osipenko пишет:

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

The patches in this series are trivial and fixing the longstanding bug on Tegra124. Could you please take a look and and ACK the series if it looks good to you?

Thank you, Peter.

Stephen, is yours maintainer-tool able to pick up the "Acked-By" for the whole series or do I need to resend the series with a proper "Acked-by" tag added to every patch? Please let me know.

The maintainer-tool is me, but I don't require you to resend to collect acks or other tags. I can do it and I'll do it today.

#9 lore raw

25.04.2019 18:14, Stephen Boyd пишет:

Quoted 9 lines

Quoting Dmitry Osipenko (2019-04-25 06:50:39)

Quoted 8 lines

24.04.2019 11:36, Peter De Schrijver пишет:

Quoted 6 lines · Dmitry Osipenko
Quoted 3 lines

12.04.2019 0:48, Dmitry Osipenko пишет:

The patches in this series are trivial and fixing the longstanding bug on Tegra124. Could you please take a look and and ACK the series if it looks good to you?

Quoted 8 lines
Quoted 4 lines

Thank you, Peter.

Stephen, is yours maintainer-tool able to pick up the "Acked-By" for the whole series or do I need to resend the series with a proper "Acked-by" tag added to every patch? Please let me know.

The maintainer-tool is me, but I don't require you to resend to collect acks or other tags. I can do it and I'll do it today.

Thank you very much!