2019-12-09 08:21:26

by Peng Fan

[permalink] [raw]
Subject: [PATCH V2] clk: imx: pll14xx: fix clk_pll14xx_wait_lock

From: Peng Fan <[email protected]>

The usage of readl_poll_timeout is wrong, the 3rd parameter(cond)
should be "val & LOCK_STATUS" not "val & LOCK_TIMEOUT_US",
It is not check whether the pll locked, LOCK_STATUS reflects the mask,
not LOCK_TIMEOUT_US.

Fixes: 8646d4dcc7fb ("clk: imx: Add PLLs driver for imx8mm soc")
Cc: <[email protected]>
Reviewed-by: Abel Vesa <[email protected]>
Signed-off-by: Peng Fan <[email protected]>
---

V2:
Update commit log, and add tag.

drivers/clk/imx/clk-pll14xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c
index a6d31a7262ef..e2384271ed83 100644
--- a/drivers/clk/imx/clk-pll14xx.c
+++ b/drivers/clk/imx/clk-pll14xx.c
@@ -166,7 +166,7 @@ static int clk_pll14xx_wait_lock(struct clk_pll14xx *pll)
{
u32 val;

- return readl_poll_timeout(pll->base, val, val & LOCK_TIMEOUT_US, 0,
+ return readl_poll_timeout(pll->base, val, val & LOCK_STATUS, 0,
LOCK_TIMEOUT_US);
}

--
2.16.4


2019-12-11 07:08:38

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH V2] clk: imx: pll14xx: fix clk_pll14xx_wait_lock

On Mon, Dec 09, 2019 at 08:19:55AM +0000, Peng Fan wrote:
> From: Peng Fan <[email protected]>
>
> The usage of readl_poll_timeout is wrong, the 3rd parameter(cond)
> should be "val & LOCK_STATUS" not "val & LOCK_TIMEOUT_US",
> It is not check whether the pll locked, LOCK_STATUS reflects the mask,
> not LOCK_TIMEOUT_US.
>
> Fixes: 8646d4dcc7fb ("clk: imx: Add PLLs driver for imx8mm soc")
> Cc: <[email protected]>
> Reviewed-by: Abel Vesa <[email protected]>
> Signed-off-by: Peng Fan <[email protected]>

Applied, thanks.