From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC737C52D70 for ; Mon, 5 Aug 2024 19:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NAQcGvK/37cY9ZJrwFjCqA+HRwCdlhENRftTIlw52hY=; b=iWN83L0gAZ6/Z0 5GkqqL+gWBPRKbp+UlGsSok6lrFx7KqWgHdeceuzATVhj2SbaOOhZdZYpkmZa53NQF9g7tVZsCSru YheR8NBH62i7pfMmsUvyuZvZxjQT37ht1vK4jAseZa8MBh70dAN3/cbpFAA23NkQKbfvCyb58/ieo qKEuXx7JEihfVtgagkXkdq//JEncMIXoRyxvotGIALI7TqsO554rQRVfK/rZbr1g+oaNiqBCl6uiv fV+HoT8GyX+hJHOn39Q6K/bPvOF5UDQNOZTT7hENiYPhmG6ZQvx0QasiSrbAGadlOPyrD1Tdw6pN/ WGAc7cLDyOE06lZ1cd8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sb3Gp-0000000GzSp-2KHd; Mon, 05 Aug 2024 19:21:27 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sb3Gm-0000000GzQr-1yCW for linux-snps-arc@lists.infradead.org; Mon, 05 Aug 2024 19:21:26 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id AFA10CE0B86; Mon, 5 Aug 2024 19:21:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACF64C4AF0E; Mon, 5 Aug 2024 19:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722885681; bh=rHLBTLGCozsc8ZYyoVtgXgyWtG7mLnt/2HwV6ku00sk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JeZmvV35UmDfaPr6trM/HZwiyXgBBYiM79k8hwahfN7zysawZ9ZqeljXBeibBxhTW XmZ9krPGcFEJSs02cDDOTWMyZaSRF7znUDHVev751sJP0Gv5Td6hPaXpo+hdRa6EyB 5yuvlDFujJRFq97YX050Lb3StOqrAPuPbgKchfcTNY5az670n41g+A3MhzgD3p3TgV LSkTsnSq9XxjrehqV/uoL5inxzoPMRQsSfLRdZErvkfBpWnqKK/HFzqcgXxjreH/hs gShiXwGHYVqWM8a5NnGHyjoTrn6zX/ubBKFaYnIOFb9aYMfniRuOSfOnGj4/V90E4B JLUUqZiU5AaXg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 50378CE10F9; Mon, 5 Aug 2024 12:21:21 -0700 (PDT) From: "Paul E. McKenney" To: 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, "Paul E. McKenney" , Andi Shyti Subject: [PATCH cmpxchg 3/3] sh: Emulate one-byte cmpxchg Date: Mon, 5 Aug 2024 12:21:19 -0700 Message-Id: <20240805192119.56816-3-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240805_122124_706576_D97985F5 X-CRM114-Status: GOOD ( 12.13 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org 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 Cc: Andi Shyti Cc: Palmer Dabbelt Cc: Masami Hiramatsu Cc: Arnd Bergmann Cc: --- 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 #include +#include #if defined(CONFIG_GUSA_RB) #include @@ -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); } -- 2.40.1 _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc