linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: "Paul E. McKenney" <paulmck@kernel.org>,
	linux-arch@vger.kernel.org,  linux-kernel@vger.kernel.org
Cc: elver@google.com, akpm@linux-foundation.org, tglx@linutronix.de,
	 peterz@infradead.org, torvalds@linux-foundation.org,
	arnd@arndb.de,  geert@linux-m68k.org, palmer@rivosinc.com,
	mhiramat@kernel.org,  linux-sh@vger.kernel.org,
	linux-snps-arc@lists.infradead.org,
	Andi Shyti <andi.shyti@linux.intel.com>
Subject: Re: [PATCH cmpxchg 3/3] sh: Emulate one-byte cmpxchg
Date: Mon, 05 Aug 2024 22:13:38 +0200	[thread overview]
Message-ID: <d36d1c197bed83f91299e5cf211ecc4169d3b7a1.camel@physik.fu-berlin.de> (raw)
In-Reply-To: <20240805192119.56816-3-paulmck@kernel.org>

On Mon, 2024-08-05 at 12:21 -0700, Paul E. McKenney wrote:
> Use the new cmpxchg_emu_u8() to emulate one-byte cmpxchg() on sh.
> 
> [ paulmck: Drop two-byte support per Arnd Bergmann feedback. ]
> [ paulmck: Apply feedback from Naresh Kamboju. ]
> [ Apply Geert Uytterhoeven feedback. ]
> 
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Cc: Andi Shyti <andi.shyti@linux.intel.com>
> Cc: Palmer Dabbelt <palmer@rivosinc.com>
> Cc: Masami Hiramatsu <mhiramat@kernel.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: <linux-sh@vger.kernel.org>
> ---
>  arch/sh/Kconfig               | 1 +
>  arch/sh/include/asm/cmpxchg.h | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 1aa3c4a0c5b27..e9103998cca91 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -14,6 +14,7 @@ config SUPERH
>  	select ARCH_HIBERNATION_POSSIBLE if MMU
>  	select ARCH_MIGHT_HAVE_PC_PARPORT
>  	select ARCH_WANT_IPC_PARSE_VERSION
> +	select ARCH_NEED_CMPXCHG_1_EMU
>  	select CPU_NO_EFFICIENT_FFS
>  	select DMA_DECLARE_COHERENT
>  	select GENERIC_ATOMIC64
> diff --git a/arch/sh/include/asm/cmpxchg.h b/arch/sh/include/asm/cmpxchg.h
> index 5d617b3ef78f7..1e5dc5ccf7bf5 100644
> --- a/arch/sh/include/asm/cmpxchg.h
> +++ b/arch/sh/include/asm/cmpxchg.h
> @@ -9,6 +9,7 @@
>  
>  #include <linux/compiler.h>
>  #include <linux/types.h>
> +#include <linux/cmpxchg-emu.h>
>  
>  #if defined(CONFIG_GUSA_RB)
>  #include <asm/cmpxchg-grb.h>
> @@ -56,6 +57,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
>  		unsigned long new, int size)
>  {
>  	switch (size) {
> +	case 1:
> +		return cmpxchg_emu_u8(ptr, old, new);
>  	case 4:
>  		return __cmpxchg_u32(ptr, old, new);
>  	}

Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

  reply	other threads:[~2024-08-05 20:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-05 19:20 [PATCH cmpxchg 0/3] Provide emulation for one-byte cmpxchg() Paul E. McKenney
2024-08-05 19:21 ` [PATCH cmpxchg 1/3] xtensa: Emulate one-byte cmpxchg Paul E. McKenney
2024-08-05 19:21 ` [PATCH cmpxchg 2/3] ARC: " Paul E. McKenney
2024-08-06  1:27   ` Vineet Gupta
2024-08-06  4:28     ` Paul E. McKenney
2024-08-06  4:44       ` Vineet Gupta
2024-08-06 13:57         ` Paul E. McKenney
2024-08-05 19:21 ` [PATCH cmpxchg 3/3] sh: " Paul E. McKenney
2024-08-05 20:13   ` John Paul Adrian Glaubitz [this message]
2024-08-05 20:33     ` Paul E. McKenney
2024-08-21 18:02 ` [PATCH v2 cmpxchg 0/3] Provide emulation for one-byte cmpxchg() for v6.12 Paul E. McKenney
2024-08-21 18:10   ` [PATCH v2 cmpxchg 3/3] sh: Emulate one-byte cmpxchg Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d36d1c197bed83f91299e5cf211ecc4169d3b7a1.camel@physik.fu-berlin.de \
    --to=glaubitz@physik.fu-berlin.de \
    --cc=akpm@linux-foundation.org \
    --cc=andi.shyti@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=elver@google.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=mhiramat@kernel.org \
    --cc=palmer@rivosinc.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).