[openib-general] [PATCH 0/7] AMSO1100 RNIC Driver

Tom Tucker tom at opengridcomputing.com
Thu Mar 9 13:55:02 PST 2006


Unless anyone objects, for now, I'm just going to go with __raw_write
(cpu_to_be32(...),...) and put wmb() between writes.

On Thu, 2006-03-09 at 07:36 -0800, Roland Dreier wrote:
>     Roland> I just realized that the amso1100 driver probably won't
>     Roland> work on a big-endian architecture.  This is actually
>     Roland> because your hardware is itself big-endian, so you end up
>     Roland> doing stuff like
> 
>     Roland> writel(cpu_to_be32(foo), bar);
> 
>     Tom> Er... isn't cpu_to_be32 a no-op when the processor is itself
>     Tom> big-endian?
> 
> Yes, that's part of the problem.  On a big-endian arch, writel()
> itself has an implied swap to little-endian, because PCI is assumed to
> be little-endian.  For example, on ppc32, writel() is defined to
> out_le32(), which uses the stwbrx instruction to do a byte-swapping store.
> 
>  - R.




More information about the general mailing list