Re: [PATCH] ppc64: Fix __raw_* IO accessors

From: Linus Torvalds
Date: Tue Sep 21 2004 - 14:43:57 EST




On Tue, 21 Sep 2004, Roland Dreier wrote:
>
> Is it possible to use __raw_*() in portable code? I have some places
> in my code where non-byte-swap IO functions would be useful, but on
> ppc64, __raw_*() doesn't know about EEH.

I don't think normal readb/writeb should know about EEH either. If you
want error handling, there's a separate interface being worked on, so that
normal accesses don't have to pay the cost..

> Clearly I don't want to
> teach portable code about IO_TOKEN_TO_ADDR etc. so it seems I'm out of
> luck. I end up doing the fairly insane:
>
> writel(swab32(val), addr);

Ok, so that _is_ insane. Mind telling what kind of insane hardware is BE
in this day and age?

That said, I think

> instead of what I really mean, which is:
>
> __raw_writel(cpu_to_be32(val), addr);

should work, and if you start using it, and the driver is relevant, I'm
sure other architectures will implement the __raw_ interfaces too. In the
meantime, please just make it conditional on the proper architectures.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/