linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] clk: Tegra124 PLLM fixes
@ 2019-04-11 21:48 Dmitry Osipenko
  2019-04-11 21:48 ` [PATCH v1 1/2] clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider Dmitry Osipenko
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dmitry Osipenko @ 2019-04-11 21:48 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Thierry Reding, Jonathan Hunter
  Cc: linux-clk, linux-tegra, linux-kernel

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(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v1 1/2] clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider
  2019-04-11 21:48 [PATCH v1 0/2] clk: Tegra124 PLLM fixes Dmitry Osipenko
@ 2019-04-11 21:48 ` Dmitry Osipenko
  2019-04-25 15:17   ` Stephen Boyd
  2019-04-11 21:48 ` [PATCH v1 2/2] clk: tegra124: Remove lock-enable bit from PLLM Dmitry Osipenko
  2019-04-19 11:50 ` [PATCH v1 0/2] clk: Tegra124 PLLM fixes Dmitry Osipenko
  2 siblings, 1 reply; 10+ messages in thread
From: Dmitry Osipenko @ 2019-04-11 21:48 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Thierry Reding, Jonathan Hunter
  Cc: linux-clk, linux-tegra, linux-kernel

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.

Cc: <stable@vger.kernel.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/clk/tegra/clk-pll.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
index b50b7460014b..3e67cbcd80da 100644
--- a/drivers/clk/tegra/clk-pll.c
+++ b/drivers/clk/tegra/clk-pll.c
@@ -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);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v1 2/2] clk: tegra124: Remove lock-enable bit from PLLM
  2019-04-11 21:48 [PATCH v1 0/2] clk: Tegra124 PLLM fixes Dmitry Osipenko
  2019-04-11 21:48 ` [PATCH v1 1/2] clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider Dmitry Osipenko
@ 2019-04-11 21:48 ` Dmitry Osipenko
  2019-04-25 15:17   ` Stephen Boyd
  2019-04-19 11:50 ` [PATCH v1 0/2] clk: Tegra124 PLLM fixes Dmitry Osipenko
  2 siblings, 1 reply; 10+ messages in thread
From: Dmitry Osipenko @ 2019-04-11 21:48 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Thierry Reding, Jonathan Hunter
  Cc: linux-clk, linux-tegra, linux-kernel

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.

Tested-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/clk/tegra/clk-tegra124.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/tegra/clk-tegra124.c b/drivers/clk/tegra/clk-tegra124.c
index df0018f7bf7e..940592375583 100644
--- a/drivers/clk/tegra/clk-tegra124.c
+++ b/drivers/clk/tegra/clk-tegra124.c
@@ -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[] = {
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 0/2] clk: Tegra124 PLLM fixes
  2019-04-11 21:48 [PATCH v1 0/2] clk: Tegra124 PLLM fixes Dmitry Osipenko
  2019-04-11 21:48 ` [PATCH v1 1/2] clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider Dmitry Osipenko
  2019-04-11 21:48 ` [PATCH v1 2/2] clk: tegra124: Remove lock-enable bit from PLLM Dmitry Osipenko
@ 2019-04-19 11:50 ` Dmitry Osipenko
  2019-04-24  8:36   ` Peter De Schrijver
  2 siblings, 1 reply; 10+ messages in thread
From: Dmitry Osipenko @ 2019-04-19 11:50 UTC (permalink / raw)
  To: Peter De Schrijver
  Cc: Prashant Gaikwad, Michael Turquette, Stephen Boyd,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-tegra,
	linux-kernel

12.04.2019 0:48, Dmitry Osipenko пишет:
> 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(-)
> 

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?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 0/2] clk: Tegra124 PLLM fixes
  2019-04-19 11:50 ` [PATCH v1 0/2] clk: Tegra124 PLLM fixes Dmitry Osipenko
@ 2019-04-24  8:36   ` Peter De Schrijver
  2019-04-25 13:50     ` Dmitry Osipenko
  0 siblings, 1 reply; 10+ messages in thread
From: Peter De Schrijver @ 2019-04-24  8:36 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Prashant Gaikwad, Michael Turquette, Stephen Boyd,
	Thierry Reding, Jonathan Hunter, linux-clk, linux-tegra,
	linux-kernel

On Fri, Apr 19, 2019 at 02:50:10PM +0300, Dmitry Osipenko wrote:
> 12.04.2019 0:48, Dmitry Osipenko пишет:
> > 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(-)
> > 
> 
> 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?

Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>                                                              


Peter.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 0/2] clk: Tegra124 PLLM fixes
  2019-04-24  8:36   ` Peter De Schrijver
@ 2019-04-25 13:50     ` Dmitry Osipenko
  2019-04-25 15:14       ` Stephen Boyd
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Osipenko @ 2019-04-25 13:50 UTC (permalink / raw)
  To: Peter De Schrijver, Stephen Boyd
  Cc: Prashant Gaikwad, Michael Turquette, Thierry Reding,
	Jonathan Hunter, linux-clk, linux-tegra, linux-kernel

24.04.2019 11:36, Peter De Schrijver пишет:
> On Fri, Apr 19, 2019 at 02:50:10PM +0300, Dmitry Osipenko wrote:
>> 12.04.2019 0:48, Dmitry Osipenko пишет:
>>> 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(-)
>>>
>>
>> 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?
> 
> Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>                                                              

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 0/2] clk: Tegra124 PLLM fixes
  2019-04-25 13:50     ` Dmitry Osipenko
@ 2019-04-25 15:14       ` Stephen Boyd
  2019-04-25 15:43         ` Dmitry Osipenko
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Boyd @ 2019-04-25 15:14 UTC (permalink / raw)
  To: Dmitry Osipenko, Peter De Schrijver
  Cc: Prashant Gaikwad, Michael Turquette, Thierry Reding,
	Jonathan Hunter, linux-clk, linux-tegra, linux-kernel

Quoting Dmitry Osipenko (2019-04-25 06:50:39)
> 24.04.2019 11:36, Peter De Schrijver пишет:
> > On Fri, Apr 19, 2019 at 02:50:10PM +0300, Dmitry Osipenko wrote:
> >> 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?
> > 
> > Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>                                                              
> 
> 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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/2] clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider
  2019-04-11 21:48 ` [PATCH v1 1/2] clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider Dmitry Osipenko
@ 2019-04-25 15:17   ` Stephen Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2019-04-25 15:17 UTC (permalink / raw)
  To: Dmitry Osipenko, Jonathan Hunter, Michael Turquette,
	Peter De Schrijver, Prashant Gaikwad, Thierry Reding
  Cc: linux-clk, linux-tegra, linux-kernel

Quoting Dmitry Osipenko (2019-04-11 14:48:34)
> 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.
> 
> Cc: <stable@vger.kernel.org>
> Tested-by: Steev Klimaszewski <steev@kali.org>
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---

Applied to clk-next


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 2/2] clk: tegra124: Remove lock-enable bit from PLLM
  2019-04-11 21:48 ` [PATCH v1 2/2] clk: tegra124: Remove lock-enable bit from PLLM Dmitry Osipenko
@ 2019-04-25 15:17   ` Stephen Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2019-04-25 15:17 UTC (permalink / raw)
  To: Dmitry Osipenko, Jonathan Hunter, Michael Turquette,
	Peter De Schrijver, Prashant Gaikwad, Thierry Reding
  Cc: linux-clk, linux-tegra, linux-kernel

Quoting Dmitry Osipenko (2019-04-11 14:48:35)
> 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.
> 
> Tested-by: Steev Klimaszewski <steev@kali.org>
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---

Applied to clk-next


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 0/2] clk: Tegra124 PLLM fixes
  2019-04-25 15:14       ` Stephen Boyd
@ 2019-04-25 15:43         ` Dmitry Osipenko
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Osipenko @ 2019-04-25 15:43 UTC (permalink / raw)
  To: Stephen Boyd, Peter De Schrijver
  Cc: Prashant Gaikwad, Michael Turquette, Thierry Reding,
	Jonathan Hunter, linux-clk, linux-tegra, linux-kernel

25.04.2019 18:14, Stephen Boyd пишет:
> Quoting Dmitry Osipenko (2019-04-25 06:50:39)
>> 24.04.2019 11:36, Peter De Schrijver пишет:
>>> On Fri, Apr 19, 2019 at 02:50:10PM +0300, Dmitry Osipenko wrote:
>>>> 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?
>>>
>>> Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>                                                              
>>
>> 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!

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-04-25 15:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-11 21:48 [PATCH v1 0/2] clk: Tegra124 PLLM fixes Dmitry Osipenko
2019-04-11 21:48 ` [PATCH v1 1/2] clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider Dmitry Osipenko
2019-04-25 15:17   ` Stephen Boyd
2019-04-11 21:48 ` [PATCH v1 2/2] clk: tegra124: Remove lock-enable bit from PLLM Dmitry Osipenko
2019-04-25 15:17   ` Stephen Boyd
2019-04-19 11:50 ` [PATCH v1 0/2] clk: Tegra124 PLLM fixes Dmitry Osipenko
2019-04-24  8:36   ` Peter De Schrijver
2019-04-25 13:50     ` Dmitry Osipenko
2019-04-25 15:14       ` Stephen Boyd
2019-04-25 15:43         ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).