On Wed, Aug 28, 2013 at 3:37 AM, Ezequiel Garcia <ezequiel.gar...@free-electrons.com> wrote: > Linus, > > Andrew suggested you might have opinions on this, so I'm cc'ing you. > Since you'll probably want some better context, here it is: > > http://lwn.net/Articles/564709/ > > On Sat, Aug 24, 2013 at 12:35:29PM -0300, Ezequiel Garcia wrote: >> Some platforms have MMIO regions that are shared across orthogonal >> subsystems. This commit implements a possible solution for the >> thread-safe access of such regions through a spinlock-protected API. >> >> Concurrent access is protected with a single spinlock for the >> entire MMIO address space. While this protects shared-registers, >> it also serializes access to unrelated/unshared registers.
I have nothing against this, except that "__HAVE_ARCH_ATOMIC_IO_MODIFY" needs to die, along with the #ifdef. It should be a CONFIG_xyz option that gets set by the architectures that have it, and then instead of an #ifdef in code, the Makefile should make the generic target be conditional. So add a generic bool GENERIC_ATOMIC_MMIO_MODIFY depends on !ARCH_ATOMIC_MMIO_MODIFY default y to the lib/Kconfig file, and then lib/Makefile just does obj-$(CONFIG_GENERIC_ATOMIC_MMIO_MODIFY) += atomic_io.o After that, ARM can then implement some architecture-optimized version, and in its own Kconfig file just do "select ARCH_ATOMIC_MMIO_MODIFY" to let the generic code know that it should disable that generic version. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/