Re: [PATCH 1 of 3] Introduce __raw_memcpy_toio32

From: Roland Dreier
Date: Tue Jan 10 2006 - 09:53:56 EST


Bryan> This arch-independent routine copies data to a
Bryan> memory-mapped I/O region, using 32-bit accesses. It does
Bryan> not guarantee access ordering, nor does it perform a memory
Bryan> barrier afterwards. This style of access is required by
Bryan> some devices.

Andrew> Not providing orderingor barriers makes this a rather
Andrew> risky thing to export - people might use it, find their
Andrew> driver "works" on one architecture, but fails on another.

Andrew> I guess the "__" is a decent warning of this, and the
Andrew> patch anticipates a higher-level raw_memcpy_toio32() which
Andrew> implements those things, yes?

I suggested the __raw_ name to parallel __raw_writel and friends. The
name for the version that ends with a write barrier would presumably
be just "memcpy_toio32()". Bryan could easily add that his patch as
well, even though the Pathscale driver will only use the __raw_ version.

Andrew> How come __raw_memcpy_toio32() is inlined?

That is a good question, especially since the optimized
x86_64-specific version is out-of-line. I suspect the answer is
mainly that that's the easiest way to stick it in a header in
include/asm-generic. I think it would be worth working a little
harder and making the generic version out-of-line.
-
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/