[2/2] arm64: io: Hook up __io_par() for inX() ordering

Message ID 20190211174544.4302-3-will.deacon@arm.com
State New
Headers show
Series
  • Ensure inX() is ordered wrt delay() routines
Related show

Commit Message

Will Deacon Feb. 11, 2019, 5:45 p.m.
Ensure that inX() provides the same ordering guarantees as readX()
by hooking up __io_par() so that it maps directly to __iormb().

Reported-by: Andrew Murray <andrew.murray@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

---
 arch/arm64/include/asm/io.h | 1 +
 1 file changed, 1 insertion(+)

-- 
2.11.0

Comments

Geert Uytterhoeven Feb. 12, 2019, 10:42 a.m. | #1
Hi Will,

On Mon, Feb 11, 2019 at 9:34 PM Will Deacon <will.deacon@arm.com> wrote:
> Ensure that inX() provides the same ordering guarantees as readX()

> by hooking up __io_par() so that it maps directly to __iormb().

>

> Reported-by: Andrew Murray <andrew.murray@arm.com>

> Signed-off-by: Will Deacon <will.deacon@arm.com>


Thanks for your patch!

> --- a/arch/arm64/include/asm/io.h

> +++ b/arch/arm64/include/asm/io.h

> @@ -121,6 +121,7 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)

>                      : "memory");                                       \

>  })

>

> +#define __io_par               __iormb


I think it makes sense to make the parameter passing explicit, for
documentation purposes:

    #define __io_par(v)        __iormb(v)

>  #define __iowmb()              wmb()

>

>  #define mmiowb()               do { } while (0)


Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Will Deacon Feb. 13, 2019, 5:25 p.m. | #2
On Tue, Feb 12, 2019 at 11:42:44AM +0100, Geert Uytterhoeven wrote:
> On Mon, Feb 11, 2019 at 9:34 PM Will Deacon <will.deacon@arm.com> wrote:

> > Ensure that inX() provides the same ordering guarantees as readX()

> > by hooking up __io_par() so that it maps directly to __iormb().

> >

> > Reported-by: Andrew Murray <andrew.murray@arm.com>

> > Signed-off-by: Will Deacon <will.deacon@arm.com>

> 

> Thanks for your patch!

> 

> > --- a/arch/arm64/include/asm/io.h

> > +++ b/arch/arm64/include/asm/io.h

> > @@ -121,6 +121,7 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)

> >                      : "memory");                                       \

> >  })

> >

> > +#define __io_par               __iormb

> 

> I think it makes sense to make the parameter passing explicit, for

> documentation purposes:

> 

>     #define __io_par(v)        __iormb(v)


Thanks, I'll make that change for v2.

Will

Patch

diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index ee723835c1f4..2985febe63ec 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -121,6 +121,7 @@  static inline u64 __raw_readq(const volatile void __iomem *addr)
 		     : "memory");					\
 })
 
+#define __io_par		__iormb
 #define __iowmb()		wmb()
 
 #define mmiowb()		do { } while (0)