Re: [PATCH] I/O space write barrier

From: Albert Cahalan
Date: Mon Oct 04 2004 - 15:51:06 EST


> diff -Nru a/include/asm-ppc/io.h b/include/asm-ppc/io.h
> --- a/include/asm-ppc/io.h 2004-09-27 10:48:41 -07:00
> +++ b/include/asm-ppc/io.h 2004-09-27 10:48:41 -07:00
> @@ -197,6 +197,8 @@
> #define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
> #define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
>
> +#define mmiowb() asm volatile ("eieio" ::: "memory")
> +
> /*
> * Map in an area of physical address space, for accessing
> * I/O devices etc.

I don't think this is right. For ppc, eieio is
already included as part of the assembly for the
IO operations. If you could delete that, great,
but I suspect that nearly all drivers would break.

There's an existing eieio() inline function that
you could use, instead of fresh assembly code.

BTW, the "eieio" name is better. The "wb" part
of "mmiowb" looks like "write back" to me, as if
it were some sort of cache push operation. It is
also lacking an appropriate song. :-)


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