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

Benjamin Herrenschmidt
2004-09-22T01:34:54Z

On Wed, 2004-09-22 at 08:05, Roland Dreier wrote:

> That means using __raw_writel() is pretty much guaranteed to blow up
> on IBM pSeries (and I do care about pSeries for my driver).

Yah, this is junk, they should filter out the token at least even if
they don't do the actual checking. I don't know why somebody did that
token thing in the first place, I'll do some investigations, but I hate
it. Note that only devices for which eeh has been enabled will be
affected.

> Maybe something like the patch below would make sense? (Reordering of
> code is to make sure IO_TOKEN_TO_ADDR() is defined before the
> __raw_*() functions; eeh.h has to be included after the in_*() and
> out_*() functions are defined)
>
> By the way, I notice that <asm-ppc64/eeh.h> has a bunch of eeh_raw_*
> functions that appear to be completely unused. I didn't use them in
> my patch because they add memory ordering (isync or sync) that Alan
> says __raw_* functions shouldn't have.
>
> Linus> Ok, so that _is_ insane. Mind telling what kind of insane
> Linus> hardware is BE in this day and age?
>
> :) Mellanox InfiniBand HCAs....

Note that I intend to clean up that mess sooner or later...

Your patch looks ok.

Ben.