[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <158464793223.152100.9637932949695874103@swboyd.mtv.corp.google.com>
Date: Thu, 19 Mar 2020 12:58:52 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Anson Huang <Anson.Huang@....com>, abel.vesa@....com,
allison@...utok.net, festevam@...il.com, gustavo@...eddedor.com,
kernel@...gutronix.de, kstewart@...uxfoundation.org,
linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org, mturquette@...libre.com,
s.hauer@...gutronix.de, shawnguo@...nel.org, tglx@...utronix.de
Cc: Linux-imx@....com
Subject: Re: [PATCH] clk: imx: clk-pllv3: Use readl_poll_timeout() for PLL lock wait
Quoting Anson Huang (2020-03-17 20:26:44)
> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
> index df91a82..3dfa9c3 100644
> --- a/drivers/clk/imx/clk-pllv3.c
> +++ b/drivers/clk/imx/clk-pllv3.c
> @@ -53,23 +56,14 @@ struct clk_pllv3 {
>
> static int clk_pllv3_wait_lock(struct clk_pllv3 *pll)
> {
> - unsigned long timeout = jiffies + msecs_to_jiffies(10);
> u32 val = readl_relaxed(pll->base) & pll->power_bit;
>
> /* No need to wait for lock when pll is not powered up */
> if ((pll->powerup_set && !val) || (!pll->powerup_set && val))
> return 0;
>
> - /* Wait for PLL to lock */
> - do {
> - if (readl_relaxed(pll->base) & BM_PLL_LOCK)
> - break;
> - if (time_after(jiffies, timeout))
> - break;
> - usleep_range(50, 500);
> - } while (1);
> -
> - return readl_relaxed(pll->base) & BM_PLL_LOCK ? 0 : -ETIMEDOUT;
> + return readl_poll_timeout(pll->base, val, val & BM_PLL_LOCK, 500,
Did you want to use readl_relaxed_poll_timeout() to keep it the same as
before?
Powered by blists - more mailing lists