public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
* RE: [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix FOUTPOSTDIV clk
       [not found] <181032168C715C4E.8579@lists.cip-project.org>
@ 2024-12-18 10:39 ` Prabhakar Mahadev Lad
  2024-12-18 15:52   ` Pavel Machek
  0 siblings, 1 reply; 6+ messages in thread
From: Prabhakar Mahadev Lad @ 2024-12-18 10:39 UTC (permalink / raw)
  To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu, Pavel Machek; +Cc: Biju Das

> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On
> Behalf Of Lad Prabhakar via lists.cip-project.org
> Sent: 11 December 2024 18:15
> To: cip-dev@lists.cip-project.org; Nobuhiro Iwamatsu
> <nobuhiro1.iwamatsu@toshiba.co.jp>; Pavel Machek <pavel@denx.de>
> Cc: Biju Das <biju.das.jz@bp.renesas.com>
> Subject: [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix FOUTPOSTDIV
> clk
> 
> From: Biju Das <biju.das.jz@bp.renesas.com>
> 
> commit dabf72b85f298970e86891b5218459c17b57b26a upstream.
> 
> While computing foutpostdiv_rate, the value of params->pl5_fracin is
> discarded, which results in the wrong refresh rate. Fix the formula for
> computing foutpostdiv_rate.
> 
> Fixes: 1561380ee72f ("clk: renesas: rzg2l: Add FOUTPOSTDIV clk support")
> Signed-off-by: Hien Huynh <hien.huynh.px@renesas.com>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Link: https://lore.kernel.org/20241024134236.315289-1-
> biju.das.jz@bp.renesas.com
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  drivers/clk/renesas/rzg2l-cpg.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
Gentle ping for review.

Cheers,
Prabhakar
 
> diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-
> cpg.c index b1952d2ee8c2..379292eb6fb1 100644
> --- a/drivers/clk/renesas/rzg2l-cpg.c
> +++ b/drivers/clk/renesas/rzg2l-cpg.c
> @@ -556,7 +556,7 @@ static unsigned long
> rzg2l_cpg_get_foutpostdiv_rate(struct rzg2l_pll5_param *params,
>  			       unsigned long rate)
>  {
> -	unsigned long foutpostdiv_rate;
> +	unsigned long foutpostdiv_rate, foutvco_rate;
> 
>  	params->pl5_intin = rate / MEGA;
>  	params->pl5_fracin = div_u64(((u64)rate % MEGA) << 24, MEGA); @@ -
> 565,10 +565,11 @@ rzg2l_cpg_get_foutpostdiv_rate(struct rzg2l_pll5_param
> *params,
>  	params->pl5_postdiv2 = 1;
>  	params->pl5_spread = 0x16;
> 
> -	foutpostdiv_rate =
> -		EXTAL_FREQ_IN_MEGA_HZ * MEGA / params->pl5_refdiv *
> -		((((params->pl5_intin << 24) + params->pl5_fracin)) >> 24) /
> -		(params->pl5_postdiv1 * params->pl5_postdiv2);
> +	foutvco_rate = div_u64(mul_u32_u32(EXTAL_FREQ_IN_MEGA_HZ * MEGA,
> +					   (params->pl5_intin << 24) + params-
> >pl5_fracin),
> +			       params->pl5_refdiv) >> 24;
> +	foutpostdiv_rate = DIV_ROUND_CLOSEST_ULL(foutvco_rate,
> +						 params->pl5_postdiv1 * params-
> >pl5_postdiv2);
> 
>  	return foutpostdiv_rate;
>  }
> --
> 2.43.0



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

* Re: [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix FOUTPOSTDIV clk
  2024-12-11 18:15 Prabhakar
@ 2024-12-18 15:42 ` Pavel Machek
  0 siblings, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2024-12-18 15:42 UTC (permalink / raw)
  To: cip-dev; +Cc: Nobuhiro Iwamatsu, Pavel Machek, Biju Das

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

Hi!

> commit dabf72b85f298970e86891b5218459c17b57b26a upstream.
> 
> While computing foutpostdiv_rate, the value of params->pl5_fracin
> is discarded, which results in the wrong refresh rate. Fix the formula
> for computing foutpostdiv_rate.

Sorry for the delay. This looks okay to me, and I can apply it (*).

Best regards,
								Pavel
(*) if it tests ok and nobody raises objections.
-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

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

* Re: [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix FOUTPOSTDIV clk
  2024-12-18 10:39 ` [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix FOUTPOSTDIV clk Prabhakar Mahadev Lad
@ 2024-12-18 15:52   ` Pavel Machek
  2024-12-18 22:16     ` nobuhiro1.iwamatsu
  2024-12-19  8:36     ` Prabhakar Mahadev Lad
  0 siblings, 2 replies; 6+ messages in thread
From: Pavel Machek @ 2024-12-18 15:52 UTC (permalink / raw)
  To: Prabhakar Mahadev Lad
  Cc: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu, Pavel Machek,
	Biju Das

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

Hi!

> > While computing foutpostdiv_rate, the value of params->pl5_fracin is
> > discarded, which results in the wrong refresh rate. Fix the formula for
> > computing foutpostdiv_rate.
> > 
> > Fixes: 1561380ee72f ("clk: renesas: rzg2l: Add FOUTPOSTDIV clk support")
> > Signed-off-by: Hien Huynh <hien.huynh.px@renesas.com>
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > Link: https://lore.kernel.org/20241024134236.315289-1-
> > biju.das.jz@bp.renesas.com
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > ---
> >  drivers/clk/renesas/rzg2l-cpg.c | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> >
> Gentle ping for review.

Again, sorry for the delay. Should we have similar patch for 6.1? I
can't seem to find that in my mailbox...

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

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

* RE: [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix FOUTPOSTDIV clk
  2024-12-18 15:52   ` Pavel Machek
@ 2024-12-18 22:16     ` nobuhiro1.iwamatsu
  2024-12-19  8:36     ` Prabhakar Mahadev Lad
  1 sibling, 0 replies; 6+ messages in thread
From: nobuhiro1.iwamatsu @ 2024-12-18 22:16 UTC (permalink / raw)
  To: pavel, prabhakar.mahadev-lad.rj; +Cc: cip-dev, biju.das.jz

Hi all,

> -----Original Message-----
> From: Pavel Machek <pavel@denx.de>
> Sent: Thursday, December 19, 2024 12:53 AM
> To: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: cip-dev@lists.cip-project.org; iwamatsu nobuhiro(岩松 信洋 ○DITC□
> DIT○OST) <nobuhiro1.iwamatsu@toshiba.co.jp>; Pavel Machek
> <pavel@denx.de>; Biju Das <biju.das.jz@bp.renesas.com>
> Subject: Re: [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix
> FOUTPOSTDIV clk
> 
> Hi!
> 
> > > While computing foutpostdiv_rate, the value of params->pl5_fracin is
> > > discarded, which results in the wrong refresh rate. Fix the formula
> > > for computing foutpostdiv_rate.
> > >
> > > Fixes: 1561380ee72f ("clk: renesas: rzg2l: Add FOUTPOSTDIV clk
> > > support")
> > > Signed-off-by: Hien Huynh <hien.huynh.px@renesas.com>
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > Link: https://lore.kernel.org/20241024134236.315289-1-
> > > biju.das.jz@bp.renesas.com
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > Signed-off-by: Lad Prabhakar
> > > <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > > ---
> > >  drivers/clk/renesas/rzg2l-cpg.c | 11 ++++++-----
> > >  1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > Gentle ping for review.
> 
> Again, sorry for the delay. Should we have similar patch for 6.1? I can't seem to
> find that in my mailbox...
> 

I could not find it either from mailbox and patchwork.
Perhaps a patch for 6.1.y-cip has not been posted.

Prabhakar, If we need this patch to 6.1.y-cip, could you send it ?

Best regards,
  Nobuhiro



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

* RE: [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix FOUTPOSTDIV clk
  2024-12-18 15:52   ` Pavel Machek
  2024-12-18 22:16     ` nobuhiro1.iwamatsu
@ 2024-12-19  8:36     ` Prabhakar Mahadev Lad
  2024-12-19 11:18       ` Pavel Machek
  1 sibling, 1 reply; 6+ messages in thread
From: Prabhakar Mahadev Lad @ 2024-12-19  8:36 UTC (permalink / raw)
  To: Pavel Machek; +Cc: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu, Biju Das

Hi Pavel,

> From: Pavel Machek <pavel@denx.de>
> Sent: 18 December 2024 15:53
> To: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: cip-dev@lists.cip-project.org; Nobuhiro Iwamatsu
> <nobuhiro1.iwamatsu@toshiba.co.jp>; Pavel Machek <pavel@denx.de>; Biju Das
> <biju.das.jz@bp.renesas.com>
> Subject: Re: [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix
> FOUTPOSTDIV clk
> 
> Hi!
> 
> > > While computing foutpostdiv_rate, the value of params->pl5_fracin is
> > > discarded, which results in the wrong refresh rate. Fix the formula
> > > for computing foutpostdiv_rate.
> > >
> > > Fixes: 1561380ee72f ("clk: renesas: rzg2l: Add FOUTPOSTDIV clk
> > > support")
> > > Signed-off-by: Hien Huynh <hien.huynh.px@renesas.com>
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > Link: https://lore.kernel.org/20241024134236.315289-1-
> > > biju.das.jz@bp.renesas.com
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > Signed-off-by: Lad Prabhakar
> > > <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > > ---
> > >  drivers/clk/renesas/rzg2l-cpg.c | 11 ++++++-----
> > >  1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > Gentle ping for review.
> 
> Again, sorry for the delay. Should we have similar patch for 6.1? I can't
> seem to find that in my mailbox...
> 
Thank you for the review. For 6.1 this patch should automatically land into CIP
via stable due to fixes tag.

Cheers,
Prabhakar


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

* Re: [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix FOUTPOSTDIV clk
  2024-12-19  8:36     ` Prabhakar Mahadev Lad
@ 2024-12-19 11:18       ` Pavel Machek
  0 siblings, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2024-12-19 11:18 UTC (permalink / raw)
  To: Prabhakar Mahadev Lad
  Cc: Pavel Machek, cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu,
	Biju Das

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

Hi!

> > Again, sorry for the delay. Should we have similar patch for 6.1? I can't
> > seem to find that in my mailbox...
> > 
> Thank you for the review. For 6.1 this patch should automatically land into CIP
> via stable due to fixes tag.

Ok, thanks for the info. Unless it is urgent, I believe it will be
better to wait for patch to land to 6.1 before merging 5.10 versions,
in future.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

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

end of thread, other threads:[~2024-12-19 11:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <181032168C715C4E.8579@lists.cip-project.org>
2024-12-18 10:39 ` [cip-dev] [PATCH 5.10.y-cip] clk: renesas: rzg2l: Fix FOUTPOSTDIV clk Prabhakar Mahadev Lad
2024-12-18 15:52   ` Pavel Machek
2024-12-18 22:16     ` nobuhiro1.iwamatsu
2024-12-19  8:36     ` Prabhakar Mahadev Lad
2024-12-19 11:18       ` Pavel Machek
2024-12-11 18:15 Prabhakar
2024-12-18 15:42 ` [cip-dev] " Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox