Patchwork [RESEND,v2,29/33] ARM: davinci: cp-intc: use readl/writel_relaxed()

login
register
mail settings
Submitter Bartosz Golaszewski
Date Feb. 11, 2019, 12:26 p.m.
Message ID <20190211122606.8662-30-brgl@bgdev.pl>
Download mbox | patch
Permalink /patch/722807/
State New
Headers show

Comments

Bartosz Golaszewski - Feb. 11, 2019, 12:26 p.m.
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Raplace all calls to __raw_readl() & __raw_writel() with readl_relaxed()
and writel_relaxed() respectively. It's safe to do as there's no
endianness conversion being done in the code.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/cp_intc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Marc Zyngier - Feb. 11, 2019, 1:08 p.m.
On 11/02/2019 12:26, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> Raplace all calls to __raw_readl() & __raw_writel() with readl_relaxed()
> and writel_relaxed() respectively. It's safe to do as there's no
> endianness conversion being done in the code.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  arch/arm/mach-davinci/cp_intc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c
> index c1efb9390655..4bbf0eba1920 100644
> --- a/arch/arm/mach-davinci/cp_intc.c
> +++ b/arch/arm/mach-davinci/cp_intc.c
> @@ -45,13 +45,13 @@ static struct irq_domain *davinci_cp_intc_irq_domain;
>  
>  static inline unsigned int davinci_cp_intc_read(unsigned int offset)
>  {
> -	return __raw_readl(davinci_cp_intc_base + offset);
> +	return readl_relaxed(davinci_cp_intc_base + offset);
>  }
>  
>  static inline void davinci_cp_intc_write(unsigned long value,
>  					 unsigned int offset)
>  {
> -	__raw_writel(value, davinci_cp_intc_base + offset);
> +	writel_relaxed(value, davinci_cp_intc_base + offset);
>  }
>  
>  static void davinci_cp_intc_ack_irq(struct irq_data *d)
> 

Same thing. Please merge this patch with the one that introduced the
__raw_writel() stuff.

	M.
Bartosz Golaszewski - Feb. 12, 2019, 9:32 a.m.
pon., 11 lut 2019 o 14:08 Marc Zyngier <marc.zyngier@arm.com> napisaƂ(a):
>
> On 11/02/2019 12:26, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > Raplace all calls to __raw_readl() & __raw_writel() with readl_relaxed()
> > and writel_relaxed() respectively. It's safe to do as there's no
> > endianness conversion being done in the code.
> >
> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > ---
> >  arch/arm/mach-davinci/cp_intc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c
> > index c1efb9390655..4bbf0eba1920 100644
> > --- a/arch/arm/mach-davinci/cp_intc.c
> > +++ b/arch/arm/mach-davinci/cp_intc.c
> > @@ -45,13 +45,13 @@ static struct irq_domain *davinci_cp_intc_irq_domain;
> >
> >  static inline unsigned int davinci_cp_intc_read(unsigned int offset)
> >  {
> > -     return __raw_readl(davinci_cp_intc_base + offset);
> > +     return readl_relaxed(davinci_cp_intc_base + offset);
> >  }
> >
> >  static inline void davinci_cp_intc_write(unsigned long value,
> >                                        unsigned int offset)
> >  {
> > -     __raw_writel(value, davinci_cp_intc_base + offset);
> > +     writel_relaxed(value, davinci_cp_intc_base + offset);
> >  }
> >
> >  static void davinci_cp_intc_ack_irq(struct irq_data *d)
> >
>
> Same thing. Please merge this patch with the one that introduced the
> __raw_writel() stuff.
>

In this case, none of my patches introduced it - it used to be like
that from the beginning, so a separate patch is justified.

Bart

Patch

diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c
index c1efb9390655..4bbf0eba1920 100644
--- a/arch/arm/mach-davinci/cp_intc.c
+++ b/arch/arm/mach-davinci/cp_intc.c
@@ -45,13 +45,13 @@  static struct irq_domain *davinci_cp_intc_irq_domain;
 
 static inline unsigned int davinci_cp_intc_read(unsigned int offset)
 {
-	return __raw_readl(davinci_cp_intc_base + offset);
+	return readl_relaxed(davinci_cp_intc_base + offset);
 }
 
 static inline void davinci_cp_intc_write(unsigned long value,
 					 unsigned int offset)
 {
-	__raw_writel(value, davinci_cp_intc_base + offset);
+	writel_relaxed(value, davinci_cp_intc_base + offset);
 }
 
 static void davinci_cp_intc_ack_irq(struct irq_data *d)