Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Michael Büsch" <mb@bu3sch.de>
To: Arend van Spriel <arend@broadcom.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	"george@znau.edu.ua" <george@znau.edu.ua>,
	"zajec5@gmail.com" <zajec5@gmail.com>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [RFC] drivers: brcmaxi: provide amba axi functionality in separate module
Date: Wed, 23 Mar 2011 15:09:34 +0100	[thread overview]
Message-ID: <1300889374.20830.1.camel@maggie> (raw)
In-Reply-To: <op.vsst8mfl3ri7v4@arend-laptop> (sfid-20110323_145439_175877_7D16E3D0)

On Wed, 2011-03-23 at 14:54 +0100, Arend van Spriel wrote: 
> On Wed, 23 Mar 2011 14:49:43 +0100, Michael Büsch <mb@bu3sch.de> wrote:
> 
> >
> >> void foobar(void *r, u32 val)
> >> {
> >>     volatile u32 dummy;
> >>
> >>     WR_REG(r, val);
> >>     dummy = RD_REG(r);
> >> }
> >>
> >> The register read is necessary to assure the register write is properly
> >> flushed out in hardware. Could removing the volatile for the dummy
> >> variable cause removal of the register read due to code optimization.
> >
> > It shouldn't optimize the read away as long as the RD_REG uses a  
> > volatile pointer internally. Which is the case if you use readl/w/b or  
> > ioread... to implement RD_REG
> 
> Well, RD_REG(r) is a macro which translates to readb((volatile u8*)r). Are  
> you referring to that being a volatile pointer or do you mean that inside  
> the accessor function readb the 'r' parameter is treated as a volatile  
> pointer.

readb uses volatile internally. That should be enough to ensure that
the read does actually happen.

-- 
Greetings Michael.


      reply	other threads:[~2011-03-23 14:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 20:16 [RFC] drivers: brcmaxi: AMBA AXI functionality library module Arend van Spriel
2011-03-21 20:16 ` [RFC] drivers: brcmaxi: provide amba axi functionality in separate module Arend van Spriel
2011-03-21 20:28   ` Randy Dunlap
2011-03-21 20:38     ` Johannes Berg
2011-03-21 20:42       ` Randy Dunlap
2011-03-21 20:45         ` Johannes Berg
2011-03-23 10:51     ` Arend van Spriel
     [not found]       ` <1300888183.18815.5.camel@Nokia-N900>
2011-03-23 13:54         ` Arend van Spriel
2011-03-23 14:09           ` Michael Büsch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300889374.20830.1.camel@maggie \
    --to=mb@bu3sch.de \
    --cc=arend@broadcom.com \
    --cc=george@znau.edu.ua \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rdunlap@xenotime.net \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox