linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation
@ 2019-10-30  0:48 Dmitry Osipenko
  2019-11-13 23:03 ` Stephen Boyd
  2019-11-14 11:54 ` Thierry Reding
  0 siblings, 2 replies; 7+ messages in thread
From: Dmitry Osipenko @ 2019-10-30  0:48 UTC (permalink / raw)
  To: Michael Turquette, Thierry Reding, Jonathan Hunter,
	Peter De Schrijver, Prashant Gaikwad, Stephen Boyd
  Cc: linux-clk, linux-tegra, linux-kernel

UART clock is divided using divisor values from DLM/DLL registers when
enable-bit is unset in clk register and clk's divider configuration isn't
taken onto account in this case. This doesn't cause any problems, but
let's add a check for the divider's enable-bit state, for consistency.

Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---

Changelog:

v2: In the comment to v1 Peter De Schrijver pointed out that UART's DLM/DLL
    registers configuration is used when enable bit is unset, thus the
    commit's title and message are changed accordingly.

 drivers/clk/tegra/clk-divider.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/tegra/clk-divider.c b/drivers/clk/tegra/clk-divider.c
index e76731fb7d69..f33c19045386 100644
--- a/drivers/clk/tegra/clk-divider.c
+++ b/drivers/clk/tegra/clk-divider.c
@@ -40,8 +40,13 @@ static unsigned long clk_frac_div_recalc_rate(struct clk_hw *hw,
 	int div, mul;
 	u64 rate = parent_rate;
 
-	reg = readl_relaxed(divider->reg) >> divider->shift;
-	div = reg & div_mask(divider);
+	reg = readl_relaxed(divider->reg);
+
+	if ((divider->flags & TEGRA_DIVIDER_UART) &&
+	    !(reg & PERIPH_CLK_UART_DIV_ENB))
+		return rate;
+
+	div = (reg >> divider->shift) & div_mask(divider);
 
 	mul = get_mul(divider);
 	div += mul;
-- 
2.23.0


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

* Re: [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation
  2019-10-30  0:48 [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation Dmitry Osipenko
@ 2019-11-13 23:03 ` Stephen Boyd
  2019-11-14 11:29   ` Dmitry Osipenko
  2019-11-14 11:54 ` Thierry Reding
  1 sibling, 1 reply; 7+ messages in thread
From: Stephen Boyd @ 2019-11-13 23:03 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-10-29 17:48:13)
> UART clock is divided using divisor values from DLM/DLL registers when
> enable-bit is unset in clk register and clk's divider configuration isn't
> taken onto account in this case. This doesn't cause any problems, but
> let's add a check for the divider's enable-bit state, for consistency.
> 
> Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---

Is this going to be picked up or should I just apply atop the tegra PR?


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

* Re: [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation
  2019-11-13 23:03 ` Stephen Boyd
@ 2019-11-14 11:29   ` Dmitry Osipenko
  2019-11-14 11:56     ` Thierry Reding
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Osipenko @ 2019-11-14 11:29 UTC (permalink / raw)
  To: Stephen Boyd, Jonathan Hunter, Michael Turquette,
	Peter De Schrijver, Prashant Gaikwad, Thierry Reding
  Cc: linux-clk, linux-tegra, linux-kernel

14.11.2019 02:03, Stephen Boyd пишет:
> Quoting Dmitry Osipenko (2019-10-29 17:48:13)
>> UART clock is divided using divisor values from DLM/DLL registers when
>> enable-bit is unset in clk register and clk's divider configuration isn't
>> taken onto account in this case. This doesn't cause any problems, but
>> let's add a check for the divider's enable-bit state, for consistency.
>>
>> Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>> ---
> 
> Is this going to be picked up or should I just apply atop the tegra PR?

Looks like this patch missed the Tegra's PR by accident.

Stephen, I assume it will be easier if you could apply this patch atop.
The patch doesn't have any dependencies on any other patches, so it's
fine to apply it separately. Thanks in advance!

Thierry, please let us know if you have any objections.

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

* Re: [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation
  2019-10-30  0:48 [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation Dmitry Osipenko
  2019-11-13 23:03 ` Stephen Boyd
@ 2019-11-14 11:54 ` Thierry Reding
  1 sibling, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2019-11-14 11:54 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Michael Turquette, Jonathan Hunter, Peter De Schrijver,
	Prashant Gaikwad, Stephen Boyd, linux-clk, linux-tegra,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1679 bytes --]

On Wed, Oct 30, 2019 at 03:48:13AM +0300, Dmitry Osipenko wrote:
> UART clock is divided using divisor values from DLM/DLL registers when
> enable-bit is unset in clk register and clk's divider configuration isn't
> taken onto account in this case. This doesn't cause any problems, but
> let's add a check for the divider's enable-bit state, for consistency.
> 
> Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
> 
> Changelog:
> 
> v2: In the comment to v1 Peter De Schrijver pointed out that UART's DLM/DLL
>     registers configuration is used when enable bit is unset, thus the
>     commit's title and message are changed accordingly.
> 
>  drivers/clk/tegra/clk-divider.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

Stephen, feel free to apply this on top of the Tegra pull requests:

Acked-by: Thierry Reding <treding@nvidia.com>

> diff --git a/drivers/clk/tegra/clk-divider.c b/drivers/clk/tegra/clk-divider.c
> index e76731fb7d69..f33c19045386 100644
> --- a/drivers/clk/tegra/clk-divider.c
> +++ b/drivers/clk/tegra/clk-divider.c
> @@ -40,8 +40,13 @@ static unsigned long clk_frac_div_recalc_rate(struct clk_hw *hw,
>  	int div, mul;
>  	u64 rate = parent_rate;
>  
> -	reg = readl_relaxed(divider->reg) >> divider->shift;
> -	div = reg & div_mask(divider);
> +	reg = readl_relaxed(divider->reg);
> +
> +	if ((divider->flags & TEGRA_DIVIDER_UART) &&
> +	    !(reg & PERIPH_CLK_UART_DIV_ENB))
> +		return rate;
> +
> +	div = (reg >> divider->shift) & div_mask(divider);
>  
>  	mul = get_mul(divider);
>  	div += mul;
> -- 
> 2.23.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation
  2019-11-14 11:29   ` Dmitry Osipenko
@ 2019-11-14 11:56     ` Thierry Reding
  2019-11-14 12:10       ` Dmitry Osipenko
  0 siblings, 1 reply; 7+ messages in thread
From: Thierry Reding @ 2019-11-14 11:56 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Stephen Boyd, Jonathan Hunter, Michael Turquette,
	Peter De Schrijver, Prashant Gaikwad, linux-clk, linux-tegra,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1439 bytes --]

On Thu, Nov 14, 2019 at 02:29:51PM +0300, Dmitry Osipenko wrote:
> 14.11.2019 02:03, Stephen Boyd пишет:
> > Quoting Dmitry Osipenko (2019-10-29 17:48:13)
> >> UART clock is divided using divisor values from DLM/DLL registers when
> >> enable-bit is unset in clk register and clk's divider configuration isn't
> >> taken onto account in this case. This doesn't cause any problems, but
> >> let's add a check for the divider's enable-bit state, for consistency.
> >>
> >> Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> >> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> >> ---
> > 
> > Is this going to be picked up or should I just apply atop the tegra PR?
> 
> Looks like this patch missed the Tegra's PR by accident.
> 
> Stephen, I assume it will be easier if you could apply this patch atop.
> The patch doesn't have any dependencies on any other patches, so it's
> fine to apply it separately. Thanks in advance!
> 
> Thierry, please let us know if you have any objections.

It's not so much that I missed to pick this up. It's just that it didn't
make it in time. This was posted just a couple of days before v5.4-rc6
and I had already finalized the branches at that point. Given that this
doesn't fix any actual issues it didn't seem worth to force it in at
that point.

That said, I don't have any objections if Stephen wants to pick this up
on top of the pull requests.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation
  2019-11-14 11:56     ` Thierry Reding
@ 2019-11-14 12:10       ` Dmitry Osipenko
  2019-11-15 21:36         ` Stephen Boyd
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Osipenko @ 2019-11-14 12:10 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Stephen Boyd, Jonathan Hunter, Michael Turquette,
	Peter De Schrijver, Prashant Gaikwad, linux-clk, linux-tegra,
	linux-kernel

14.11.2019 14:56, Thierry Reding пишет:
> On Thu, Nov 14, 2019 at 02:29:51PM +0300, Dmitry Osipenko wrote:
>> 14.11.2019 02:03, Stephen Boyd пишет:
>>> Quoting Dmitry Osipenko (2019-10-29 17:48:13)
>>>> UART clock is divided using divisor values from DLM/DLL registers when
>>>> enable-bit is unset in clk register and clk's divider configuration isn't
>>>> taken onto account in this case. This doesn't cause any problems, but
>>>> let's add a check for the divider's enable-bit state, for consistency.
>>>>
>>>> Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
>>>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>>>> ---
>>>
>>> Is this going to be picked up or should I just apply atop the tegra PR?
>>
>> Looks like this patch missed the Tegra's PR by accident.
>>
>> Stephen, I assume it will be easier if you could apply this patch atop.
>> The patch doesn't have any dependencies on any other patches, so it's
>> fine to apply it separately. Thanks in advance!
>>
>> Thierry, please let us know if you have any objections.
> 
> It's not so much that I missed to pick this up. It's just that it didn't
> make it in time. This was posted just a couple of days before v5.4-rc6
> and I had already finalized the branches at that point. Given that this
> doesn't fix any actual issues it didn't seem worth to force it in at
> that point.
> 
> That said, I don't have any objections if Stephen wants to pick this up
> on top of the pull requests.

Thanks!

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

* Re: [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation
  2019-11-14 12:10       ` Dmitry Osipenko
@ 2019-11-15 21:36         ` Stephen Boyd
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2019-11-15 21:36 UTC (permalink / raw)
  To: Dmitry Osipenko, Thierry Reding
  Cc: Jonathan Hunter, Michael Turquette, Peter De Schrijver,
	Prashant Gaikwad, linux-clk, linux-tegra, linux-kernel

Quoting Dmitry Osipenko (2019-11-14 04:10:51)
> > 
> > It's not so much that I missed to pick this up. It's just that it didn't
> > make it in time. This was posted just a couple of days before v5.4-rc6
> > and I had already finalized the branches at that point. Given that this
> > doesn't fix any actual issues it didn't seem worth to force it in at
> > that point.
> > 
> > That said, I don't have any objections if Stephen wants to pick this up
> > on top of the pull requests.
> 
> Thanks!

I'm fine to wait for it to come through a pull request next time. I just
wanted to know what to do with this patch in my queue.


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

end of thread, other threads:[~2019-11-15 21:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30  0:48 [PATCH v2] clk: tegra: divider: Check UART's divider enable-bit state on rate's recalculation Dmitry Osipenko
2019-11-13 23:03 ` Stephen Boyd
2019-11-14 11:29   ` Dmitry Osipenko
2019-11-14 11:56     ` Thierry Reding
2019-11-14 12:10       ` Dmitry Osipenko
2019-11-15 21:36         ` Stephen Boyd
2019-11-14 11:54 ` Thierry Reding

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