[PATCH] arm: fix regression in ixp4xx clocksource

Mikael Pettersson
2011-06-11T13:18:31Z

Richard Cochran writes:
> > > I understand (or have been told) that almost all arm implementations
> > > out there are little endian. Why not use use a normal load to read the
> > > timer? Are there machines with LE peripheral buses but BE cores?
> >
> > ARM cores often have software-controllable endianess (see the ARM ARM).
> > Off the top of my head:
> > - ixp4xx: natively BE core and peripherals, but some people like to
> > switch the core to LE for user-space SW compatibility reasons
> > (I run my ixp4xx in BE as intended though)
> > - Kirkwood: natively LE core and peripherals, but the core is switchable
> > to BE, although driver support for that appears to be incomplete
>
> So, would you say that using le_to_cpu in the MMIO clocksource reading
> functions makes good sense, or not?

There has to be a place for optional endianess conversion (le_to_cpu,
be_to_cpu, or none at all) somewhere in the MMIO access paths, and it
has to be controlled by platform code. I don't know the new clocksource
code well enough to suggest exactly where that should be done.