[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140422160821.GA31322@arm.com>
Date: Tue, 22 Apr 2014 17:08:21 +0100
From: Will Deacon <will.deacon@....com>
To: "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc: "arnd@...db.de" <arnd@...db.de>,
"monstr@...str.eu" <monstr@...str.eu>,
"dhowells@...hat.com" <dhowells@...hat.com>,
"broonie@...aro.org" <broonie@...aro.org>,
"benh@...nel.crashing.org" <benh@...nel.crashing.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"paulmck@...ux.vnet.ibm.com" <paulmck@...ux.vnet.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH 16/18] x86: io: implement dummy relaxed accessor macros
for writes
On Thu, Apr 17, 2014 at 02:44:19PM +0100, Will Deacon wrote:
> write{b,w,l,q}_relaxed are implemented by some architectures in order to
> permit memory-mapped I/O accesses with weaker barrier semantics than the
> non-relaxed variants.
>
> This patch adds dummy macros for the write accessors to x86, in the
> same vein as the dummy definitions for the relaxed read accessors.
>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Signed-off-by: Will Deacon <will.deacon@....com>
> ---
> arch/x86/include/asm/io.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> index b8237d8a1e0c..2ea07f5ec7b7 100644
> --- a/arch/x86/include/asm/io.h
> +++ b/arch/x86/include/asm/io.h
> @@ -74,6 +74,9 @@ build_mmio_write(__writel, "l", unsigned int, "r", )
> #define __raw_readw __readw
> #define __raw_readl __readl
>
> +#define writeb_relaxed(v, a) __writeb(v, a)
> +#define writew_relaxed(v, a) __writew(v, a)
> +#define writel_relaxed(v, a) __writel(v, a)
> #define __raw_writeb __writeb
> #define __raw_writew __writew
> #define __raw_writel __writel
> @@ -86,6 +89,7 @@ build_mmio_read(readq, "q", unsigned long, "=r", :"memory")
> build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
>
> #define readq_relaxed(a) readq(a)
> +#define writeq_relaxed(v, a) writeq(v, a)
Actually, I should be using the regular (i.e. without the double underscore
prefix) accessors for the relaxed variants, including the existing read
flavours here. The proposed semantics are that the accessors are ordered
with respect to each other, which necessitates a compiler barrier.
Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists