From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH v3 09/17] m68k: io: implement dummy relaxed accessor macros for writes Date: Thu, 25 Sep 2014 10:33:09 +0100 Message-ID: <20140925093309.GG20043@arm.com> References: <1411579056-16966-1-git-send-email-will.deacon@arm.com> <1411579056-16966-10-git-send-email-will.deacon@arm.com> <54236A67.90001@uclinux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:55982 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751985AbaIYJeL (ORCPT ); Thu, 25 Sep 2014 05:34:11 -0400 Content-Disposition: inline In-Reply-To: <54236A67.90001@uclinux.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Greg Ungerer Cc: "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "arnd@arndb.de" , "benh@kernel.crashing.org" , "chris@zankel.net" , "cmetcalf@tilera.com" , "davem@davemloft.net" , "deller@gmx.de" , "dhowells@redhat.com" , "geert@linux-m68k.org" , "heiko.carstens@de.ibm.com" , "hpa@zytor.com" , "jcmvbkbc@gmail.com" , "jesper.nilsson@axis.com" , "mingo@redhat.com" , "monstr@monstr.eu" , "paulmck@linux.vnet.ibm.com" , "rdunlap@infradead.org" , "sam@ravnborg.org" s On Thu, Sep 25, 2014 at 02:05:43AM +0100, Greg Ungerer wrote: > Hi Will Hi Greg, Thanks for taking a look. > On 25/09/14 03:17, Will Deacon wrote: > > write{b,w,l}_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 m68k, in the > > same vein as the dummy definitions for the relaxed read accessors. > > Additionally, the existing relaxed read accessors are moved into > > asm/io.h, so that they can be used by m68k targets with an MMU. > > > > Acked-by: Geert Uytterhoeven > > Signed-off-by: Will Deacon > > --- > > arch/m68k/include/asm/io.h | 8 ++++++++ > > arch/m68k/include/asm/io_no.h | 4 ---- > > 2 files changed, 8 insertions(+), 4 deletions(-) > > > > diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h > > index c70cc9155003..bccd5a914eb6 100644 > > --- a/arch/m68k/include/asm/io.h > > +++ b/arch/m68k/include/asm/io.h > > @@ -3,3 +3,11 @@ > > #else > > #include > > #endif > > + > > +#define readb_relaxed(addr) readb(addr) > > +#define readw_relaxed(addr) readw(addr) > > +#define readl_relaxed(addr) readl(addr) > > + > > +#define writeb_relaxed(b, addr) writeb(b, addr) > > +#define writew_relaxed(b, addr) writew(b, addr) > > +#define writel_relaxed(b, addr) writel(b, addr) > > Putting them here means they won't have any multiple include protection > (there is no "#ifndef _IO_H" around them). Doesn't seem to lead to > any problems in practice. Just flagging it... That's easy enough to fix, and actually, we should have __KERNEL__ checks here too. Fixup below. Will --->8 diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h index bccd5a914eb6..ded201916560 100644 --- a/arch/m68k/include/asm/io.h +++ b/arch/m68k/include/asm/io.h @@ -1,9 +1,14 @@ +#ifndef _M68K_IO_H +#define _M68K_IO_H + #ifdef __uClinux__ #include #else #include #endif +#ifdef __KERNEL__ + #define readb_relaxed(addr) readb(addr) #define readw_relaxed(addr) readw(addr) #define readl_relaxed(addr) readl(addr) @@ -11,3 +16,6 @@ #define writeb_relaxed(b, addr) writeb(b, addr) #define writew_relaxed(b, addr) writew(b, addr) #define writel_relaxed(b, addr) writel(b, addr) + +#endif /* __KERNEL__ */ +#endif /* _M68K_IO_H */ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:55982 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751985AbaIYJeL (ORCPT ); Thu, 25 Sep 2014 05:34:11 -0400 Date: Thu, 25 Sep 2014 10:33:09 +0100 From: Will Deacon Subject: Re: [PATCH v3 09/17] m68k: io: implement dummy relaxed accessor macros for writes Message-ID: <20140925093309.GG20043@arm.com> References: <1411579056-16966-1-git-send-email-will.deacon@arm.com> <1411579056-16966-10-git-send-email-will.deacon@arm.com> <54236A67.90001@uclinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54236A67.90001@uclinux.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Greg Ungerer Cc: "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "arnd@arndb.de" , "benh@kernel.crashing.org" , "chris@zankel.net" , "cmetcalf@tilera.com" , "davem@davemloft.net" , "deller@gmx.de" , "dhowells@redhat.com" , "geert@linux-m68k.org" , "heiko.carstens@de.ibm.com" , "hpa@zytor.com" , "jcmvbkbc@gmail.com" , "jesper.nilsson@axis.com" , "mingo@redhat.com" , "monstr@monstr.eu" , "paulmck@linux.vnet.ibm.com" , "rdunlap@infradead.org" , "sam@ravnborg.org" , "schwidefsky@de.ibm.com" , "starvik@axis.com" , "takata@linux-m32r.org" , "tglx@linutronix.de" , "tony.luck@intel.com" , "daniel.thompson@linaro.org" , "broonie@linaro.org" , "linux@arm.linux.org.uk" Message-ID: <20140925093309.0cjqwUet3VGitp7FqEthv29whOkcLTVBd2rHXMFmLd8@z> On Thu, Sep 25, 2014 at 02:05:43AM +0100, Greg Ungerer wrote: > Hi Will Hi Greg, Thanks for taking a look. > On 25/09/14 03:17, Will Deacon wrote: > > write{b,w,l}_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 m68k, in the > > same vein as the dummy definitions for the relaxed read accessors. > > Additionally, the existing relaxed read accessors are moved into > > asm/io.h, so that they can be used by m68k targets with an MMU. > > > > Acked-by: Geert Uytterhoeven > > Signed-off-by: Will Deacon > > --- > > arch/m68k/include/asm/io.h | 8 ++++++++ > > arch/m68k/include/asm/io_no.h | 4 ---- > > 2 files changed, 8 insertions(+), 4 deletions(-) > > > > diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h > > index c70cc9155003..bccd5a914eb6 100644 > > --- a/arch/m68k/include/asm/io.h > > +++ b/arch/m68k/include/asm/io.h > > @@ -3,3 +3,11 @@ > > #else > > #include > > #endif > > + > > +#define readb_relaxed(addr) readb(addr) > > +#define readw_relaxed(addr) readw(addr) > > +#define readl_relaxed(addr) readl(addr) > > + > > +#define writeb_relaxed(b, addr) writeb(b, addr) > > +#define writew_relaxed(b, addr) writew(b, addr) > > +#define writel_relaxed(b, addr) writel(b, addr) > > Putting them here means they won't have any multiple include protection > (there is no "#ifndef _IO_H" around them). Doesn't seem to lead to > any problems in practice. Just flagging it... That's easy enough to fix, and actually, we should have __KERNEL__ checks here too. Fixup below. Will --->8 diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h index bccd5a914eb6..ded201916560 100644 --- a/arch/m68k/include/asm/io.h +++ b/arch/m68k/include/asm/io.h @@ -1,9 +1,14 @@ +#ifndef _M68K_IO_H +#define _M68K_IO_H + #ifdef __uClinux__ #include #else #include #endif +#ifdef __KERNEL__ + #define readb_relaxed(addr) readb(addr) #define readw_relaxed(addr) readw(addr) #define readl_relaxed(addr) readl(addr) @@ -11,3 +16,6 @@ #define writeb_relaxed(b, addr) writeb(b, addr) #define writew_relaxed(b, addr) writew(b, addr) #define writel_relaxed(b, addr) writel(b, addr) + +#endif /* __KERNEL__ */ +#endif /* _M68K_IO_H */