diff mbox series

[RFC,cmpxchg,7/8] parisc: Emulate two-byte cmpxchg

Message ID 20240401213950.3910531-7-paulmck@kernel.org (mailing list archive)
State New
Headers show
Series None | expand

Commit Message

Paul E. McKenney April 1, 2024, 9:39 p.m. UTC
Use the new cmpxchg_emu_u16() to emulate two-byte cmpxchg() on parisc.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Palmer Dabbelt <palmer@rivosinc.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: <linux-parisc@vger.kernel.org>
---
 arch/parisc/Kconfig               | 1 +
 arch/parisc/include/asm/cmpxchg.h | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index daafeb20f9937..06f221a3f3459 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -15,6 +15,7 @@  config PARISC
 	select ARCH_HAS_STRICT_MODULE_RWX
 	select ARCH_HAS_UBSAN
 	select ARCH_HAS_PTE_SPECIAL
+	select ARCH_NEED_CMPXCHG_1_2_EMU
 	select ARCH_NO_SG_CHAIN
 	select ARCH_SUPPORTS_HUGETLBFS if PA20
 	select ARCH_SUPPORTS_MEMORY_FAILURE
diff --git a/arch/parisc/include/asm/cmpxchg.h b/arch/parisc/include/asm/cmpxchg.h
index c1d776bb16b4e..f909c000b6577 100644
--- a/arch/parisc/include/asm/cmpxchg.h
+++ b/arch/parisc/include/asm/cmpxchg.h
@@ -72,6 +72,7 @@  __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
 #endif
 	case 4: return __cmpxchg_u32((unsigned int *)ptr,
 				     (unsigned int)old, (unsigned int)new_);
+	case 2: return cmpxchg_emu_u16((volatile u16 *)ptr, old, new);
 	case 1: return __cmpxchg_u8((u8 *)ptr, old & 0xff, new_ & 0xff);
 	}
 	__cmpxchg_called_with_bad_pointer();