[PATCH v5 08/20] ARM: shmobile: r8a7779: Add helper to read mode pins

Simon Horman horms at verge.net.au
Wed Apr 16 01:26:01 PDT 2014


On Wed, Apr 16, 2014 at 10:12:32AM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, Apr 16, 2014 at 9:55 AM, Simon Horman <horms at verge.net.au> wrote:
> >> > +u32 __init r8a7779_read_mode_pins(void)
> >> > +{
> >> > +       void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
> >> > +       u32 mode;
> >> > +
> >> > +       BUG_ON(!modemr);
> >> > +       mode = ioread32(modemr);
> >> > +       iounmap(modemr);
> >> > +
> >> > +       return mode;
> >> > +}
> >>
> >> No caching, cfr. rcar_gen2_read_mode_pins()?
> >
> > I have one question about caching, which IIRC you
> > implemented for R-Car Gen 2. Is the code called often enough
> > that it makes any difference?
> 
> 2 times. (Add 1 more time with "[PATCH 1/5] [DEBUG] ARM: shmobile:
>  r8a7791: Disable MSTP clocks during boot" applied).
> 
> I agree it's not much, I'm mostly concerned about the ioremap()/iounmap()
> pair, which is expensive compared to using a cached integer value.

Thanks, I understand. I agree its reasonable
to implement caching for this.



More information about the linux-arm-kernel mailing list