This series makes a bunch of cleanups & improvements to the cmpxchg() & xchg() macros & functions, allowing them to be used on values smaller than 4 bytes, then switches MIPS over to use generic queued spinlocks & queued read/write locks. Applies atop v4.12-rc4. Paul Burton (11): MIPS: cmpxchg: Unify R10000_LLSC_WAR & non-R10000_LLSC_WAR cases MIPS: cmpxchg: Pull xchg() asm into a macro MIPS: cmpxchg: Use __compiletime_error() for bad cmpxchg() pointers MIPS: cmpxchg: Error out on unsupported xchg() calls MIPS: cmpxchg: Drop __xchg_u{32,64} functions MIPS: cmpxchg: Implement __cmpxchg() as a function MIPS: cmpxchg: Implement 1 byte & 2 byte xchg() MIPS: cmpxchg: Implement 1 byte & 2 byte cmpxchg() MIPS: cmpxchg: Rearrange __xchg() arguments to match xchg() MIPS: Use queued read/write locks (qrwlock) MIPS: Use queued spinlocks (qspinlock) arch/mips/Kconfig | 2 + arch/mips/include/asm/Kbuild | 2 + arch/mips/include/asm/cmpxchg.h | 280 ++++++++++------------ arch/mips/include/asm/spinlock.h | 426 +-------------------------------- arch/mips/include/asm/spinlock_types.h | 34 +-- arch/mips/kernel/Makefile | 2 +- arch/mips/kernel/cmpxchg.c | 109 +++++++++ 7 files changed, 239 insertions(+), 616 deletions(-) create mode 100644 arch/mips/kernel/cmpxchg.c -- 2.13.1