From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH ARM v8 2/4] mini-os: arm: interrupt controller Date: Wed, 22 Oct 2014 10:03:39 +0100 Message-ID: <1413968619.20604.56.camel@citrix.com> References: <1412328051-20015-1-git-send-email-talex5@gmail.com> <1412328051-20015-3-git-send-email-talex5@gmail.com> <1413889218.23337.24.camel@citrix.com> <20141021215406.GJ3481@type.youpi.perso.aquilenet.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XgrpY-0006Eh-0R for xen-devel@lists.xenproject.org; Wed, 22 Oct 2014 09:03:44 +0000 In-Reply-To: <20141021215406.GJ3481@type.youpi.perso.aquilenet.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Samuel Thibault Cc: xen-devel@lists.xenproject.org, Thomas Leonard , stefano.stabellini@eu.citrix.com, Dave.Scott@eu.citrix.com, anil@recoil.org List-Id: xen-devel@lists.xenproject.org On Tue, 2014-10-21 at 23:54 +0200, Samuel Thibault wrote: > Ian Campbell, le Tue 21 Oct 2014 12:00:18 +0100, a =E9crit : > > On Fri, 2014-10-03 at 10:20 +0100, Thomas Leonard wrote: > > > +static inline uint32_t REG_READ32(volatile uint32_t *addr) > > > +{ > > > + uint32_t value; > > > + __asm__ __volatile__("ldr %0, [%1]":"=3D&r"(value):"r"(addr)); > > > + rmb(); > > = > > I'm not 100% convinced that you need this rmb(). > > = > > > + return value; > > > +} > > > + > > > +static inline void REG_WRITE32(volatile uint32_t *addr, unsigned int= value) > > > +{ > > > + __asm__ __volatile__("str %0, [%1]"::"r"(value), "r"(addr)); > > > + wmb(); > > > +} > = > I don't really see why such barriers are needed indeed. Are they needed > to actually push the values out? That would, I think, require an isb() (instruction barrier) whereas wmb() turns into a dsb() (data barrier). I expect you are write and these rmb/wmb are not needed, but an isb may be needed in the caller if they want to rely on the affect of a write (e.g. enabling the controller) Ian.