Search Linux Wireless

Re: [RFC] drivers: brcmaxi: provide amba axi functionality in separate module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux