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

Geert Uytterhoeven geert at linux-m68k.org
Wed Apr 16 01:12:32 PDT 2014


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.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



More information about the linux-arm-kernel mailing list