All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: Loic Poulain <loic.poulain@linaro.org>,
	"sbabic@denx.de" <sbabic@denx.de>,
	"festevam@gmail.com" <festevam@gmail.com>
Cc: "u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	Alice Guo <alice.guo@nxp.com>, dl-uboot-imx <uboot-imx@nxp.com>,
	Ye Li <ye.li@nxp.com>
Subject: Re: [PATCH] imx8ulp: clock: Fix lcd clock algo
Date: Thu, 7 Apr 2022 11:12:26 +0800	[thread overview]
Message-ID: <42718380-e687-707f-fcd8-55d86ca84af9@oss.nxp.com> (raw)
In-Reply-To: <1648723177-28218-1-git-send-email-loic.poulain@linaro.org>



On 2022/3/31 18:39, Loic Poulain wrote:
> The div loop uses reassign and reuse parent_rate, which causes
> the parent rate reference to be wrong after the first loop, the
> resulting clock becomes incorrect for div != 1.
> 
> Fixes: 829e06bf4175 ("imx8ulp: clock: Add MIPI DSI clock and DCNano clock")
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> ---
>   arch/arm/mach-imx/imx8ulp/clock.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/imx8ulp/clock.c b/arch/arm/mach-imx/imx8ulp/clock.c
> index 91580b2..dbe0f78 100644
> --- a/arch/arm/mach-imx/imx8ulp/clock.c
> +++ b/arch/arm/mach-imx/imx8ulp/clock.c
> @@ -381,10 +381,9 @@ void mxs_set_lcdclk(u32 base_addr, u32 freq_in_khz)
>   	debug("PLL4 rate %ukhz\n", pll4_rate);
>   
>   	for (pfd = 12; pfd <= 35; pfd++) {
> -		parent_rate = pll4_rate;
> -		parent_rate = parent_rate * 18 / pfd;
> -
>   		for (div = 1; div <= 64; div++) {
> +			parent_rate = pll4_rate;
> +			parent_rate = parent_rate * 18 / pfd;
>   			parent_rate = parent_rate / div;
>   
>   			for (pcd = 0; pcd < 8; pcd++) {
> 

  reply	other threads:[~2022-04-07  3:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 10:39 [PATCH] imx8ulp: clock: Fix lcd clock algo Loic Poulain
2022-04-07  3:12 ` Peng Fan (OSS) [this message]
2022-04-21 12:26 ` sbabic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42718380-e687-707f-fcd8-55d86ca84af9@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=alice.guo@nxp.com \
    --cc=festevam@gmail.com \
    --cc=loic.poulain@linaro.org \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.