[PATCH] arm: fix regression in ixp4xx clocksource

Richard Cochran
2011-06-11T12:49:55Z

On Sat, Jun 11, 2011 at 01:22:18PM +0200, Mikael Pettersson wrote:
> Richard Cochran writes:
> > I took another look at the whole MMIO clocksource implementation and
> > can't understand why all of the accessors use le_to_cpu. This seems to
> > imply that all peripheral buses are little endian (except for ixp,
> > which no one cares about, anyhow).
>
> "no one"? ixp4xx is still being used.

Yes, I know, but I was trying and failed to sound sacastic.

> > 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?

Thanks,
Richard