diff mbox series

[1/2] clk: imx: pll14xx: use writel_relaxed

Message ID 1573629763-18389-2-git-send-email-peng.fan@nxp.com (mailing list archive)
State New, archived
Headers show
Series clk: imx: pll14xx: io relaxed fix | expand

Commit Message

Peng Fan Nov. 13, 2019, 7:24 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

It not make sense to use writel, use relaxed variant.

Cc: Will Deacon <will@kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clk/imx/clk-pll14xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Baluta Nov. 13, 2019, 11:10 a.m. UTC | #1
On Wed, 2019-11-13 at 07:24 +0000, Peng Fan wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> It not make sense to use writel, use relaxed variant.
> 

Hi Peng,

Please explain why this change is needed.
Peng Fan Nov. 13, 2019, 12:15 p.m. UTC | #2
Hi Daniel,

> Subject: Re: [PATCH 1/2] clk: imx: pll14xx: use writel_relaxed
> 
> 
> On Wed, 2019-11-13 at 07:24 +0000, Peng Fan wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > It not make sense to use writel, use relaxed variant.
> >
> 
> Hi Peng,
> 
> Please explain why this change is needed.

writel has a barrier, however that barrier is not needed,
because device memory access is in order and clk driver
has spin_lock or other lock to make sure write finished.

I would hear more comments before I post V2 about
the change and other similar patches to switch to
use relaxed API.

Thanks,
Peng.
Daniel Baluta Nov. 13, 2019, 12:35 p.m. UTC | #3
On Wed, 2019-11-13 at 12:15 +0000, Peng Fan wrote:
> Hi Daniel,
> 
> > Subject: Re: [PATCH 1/2] clk: imx: pll14xx: use writel_relaxed
> > 
> > 
> > On Wed, 2019-11-13 at 07:24 +0000, Peng Fan wrote:
> > > From: Peng Fan <peng.fan@nxp.com>
> > > 
> > > It not make sense to use writel, use relaxed variant.
> > > 
> > 
> > Hi Peng,
> > 
> > Please explain why this change is needed.
> 
> writel has a barrier, however that barrier is not needed,
> because device memory access is in order and clk driver
> has spin_lock or other lock to make sure write finished.
> 

Make sure you add this in the commit message for v2 :).
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c
index 5682fce9f5e5..e34813904023 100644
--- a/drivers/clk/imx/clk-pll14xx.c
+++ b/drivers/clk/imx/clk-pll14xx.c
@@ -199,7 +199,7 @@  static int clk_pll1416x_set_rate(struct clk_hw *hw, unsigned long drate,
 
 	/* Enable BYPASS */
 	tmp |= BYPASS_MASK;
-	writel(tmp, pll->base);
+	writel_relaxed(tmp, pll->base);
 
 	div_val = (rate->mdiv << MDIV_SHIFT) | (rate->pdiv << PDIV_SHIFT) |
 		(rate->sdiv << SDIV_SHIFT);