Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp255406lqb; Tue, 4 Jun 2024 10:18:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxbnqY5v1aQ6/99jx1J51x2VluSC+cd4tvSlPXmLPdQK/h4QGSl2eZX++SYalckXrPnay638733lBbrwEt7w2goUC5U42VkNW49pdFXg== X-Google-Smtp-Source: AGHT+IGlnGJrgxN7tXZEEJ4UdQw/H3hYSSf5CjzKLrC5xEAKz5A3FC4ELsk5mTlYs0Ny+rKuJBiR X-Received: by 2002:a50:f617:0:b0:57a:2586:b2ed with SMTP id 4fb4d7f45d1cf-57a8b67bb10mr149313a12.4.1717521524630; Tue, 04 Jun 2024 10:18:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717521524; cv=pass; d=google.com; s=arc-20160816; b=G2LSEWpEU5SHdGtHlxMIqmWQOZsRd2IrkzxQztsp7KftC2EQo1uXTvrQlCc2iw8ji4 WNLpTkxL3k0rPOyuFeGhfqegmqbhiU3KptUEup1ZfLMCeCdb8JV7QxOAa9TdVtkEVwSH 9P9hfJez23PPcIBQSs+TFMdgWhRUJBBJYD67Fk5aTdMXvOzWYMrIw99IvUGLkW4AM0vE KVvrXCmVA2Gpq2xZFTlwgtgnF74mD64RyZK/mlPCeLC8eNARWQDtq6oeWwf+D0BnmST8 O/y4j29kB4aqHZb6OvqX+28Q/qJ/rAfhc9fTlTAARAsYNxAeva7b3Yj45zoQWKNDcM/O z5/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=xaf8913xcjDgYsoFANplIr5ZjcU89fgw4ngc6yfnaPI=; fh=+Gr3EM5Pe73xnxpknjFsHBg6w9o+5SEYClwtRmU/05U=; b=rWSc+tjlahloGZUflyn6pgTD1Jll8snQ5fN/QJlS1QheaQVhWiZnHDI8Ve6t6HtGYz NU4cTqJb6bTR7H7eaSmxNbL+kCdAIKAv/5aSSLgZAWLhSsArsYWOtSCwHQmxglSqUAeV /3Kv7u1gcDDDmPCbWJU0LySKQzHpX3qAKpxiutY6508MWg0dTHWAxedc9Q1uUiQU5Cef GOMdM0s1AxVgS+ybv9R3FNbd9Dt7AIBL8w5EHnWh7quGhlVAgb2zsEqAa9Wz5RarmO8j zstN12G11xhq8JztxZGfGUx/IQbsRrUKzNVXwaQoNO3JZeEav0VmLlAjDBDg/OangCdM Y9+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@fu-berlin.de header.s=fub01 header.b=D+tsgmfL; arc=pass (i=1 spf=pass spfdomain=zedat.fu-berlin.de dkim=pass dkdomain=fu-berlin.de dmarc=pass fromdomain=physik.fu-berlin.de); spf=pass (google.com: domain of linux-kernel+bounces-201136-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fu-berlin.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31bad382si5424107a12.192.2024.06.04.10.18.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 10:18:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201136-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail header.i=@fu-berlin.de header.s=fub01 header.b=D+tsgmfL; arc=pass (i=1 spf=pass spfdomain=zedat.fu-berlin.de dkim=pass dkdomain=fu-berlin.de dmarc=pass fromdomain=physik.fu-berlin.de); spf=pass (google.com: domain of linux-kernel+bounces-201136-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fu-berlin.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 166F11F27C6F for ; Tue, 4 Jun 2024 17:09:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0E82149C67; Tue, 4 Jun 2024 17:09:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=fu-berlin.de header.i=@fu-berlin.de header.b="D+tsgmfL" Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F241C146A7A; Tue, 4 Jun 2024 17:09:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=130.133.4.66 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717520967; cv=none; b=jX6tc2jMIDKqyD5+oMSDA52ERvaRMBAI25FL5xTZwiWANdhbdwv5ZujIdtZdAI+bVTxFoMimC6Ch5rf4lS0UIa63JjHL4Xo4on2itt8MDkHScqC79PEE8Q1sytD45zoJjJoS2f2x2xvuzV7rCmIgURwb4j/SI6d5G+LLhtBhhNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717520967; c=relaxed/simple; bh=Tmsnbn8947mPtgG/FP1if5b9r64LMS46HnX1FZOK5Xg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=H0XBP+m3k3ZO/e5KHn7BDBnlFBGeZNI2WnxfRVfPVvLjpTmUFf0VTKRlZ5t83P8wb3J54pYIc78GHgRo+KliJ9qdVehu9UzCNYG8091m1DusLXHmTtNVPsOjhLbMNnFry66Cen3OefCQTBx2IEQr0CpD2hXu4tB4lummaeBf+g8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=physik.fu-berlin.de; spf=pass smtp.mailfrom=zedat.fu-berlin.de; dkim=pass (2048-bit key) header.d=fu-berlin.de header.i=@fu-berlin.de header.b=D+tsgmfL; arc=none smtp.client-ip=130.133.4.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=physik.fu-berlin.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zedat.fu-berlin.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fu-berlin.de; s=fub01; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=xaf8913xcjDgYsoFANplIr5ZjcU89fgw4ngc6yfnaPI=; t=1717520963; x=1718125763; b=D+tsgmfLZEn1sPGj0PImdVjtw1KRYCMwfC6mxUFXp1VIYcn4pHd2n3YFx+hJ0ryBpFZwmWtjkAk zmBZ0S3cGr/wFnRY+4ikO4dnSvILbsxWV1VSveNBIdHi60m0by/fRJ5iKlhOu/nVjLh9LoqaaCYUg DqUcuHQNnmmNNSwjX523LQhbUxu6fuopRkP3TS8+4mptPYTbniy40Njc0p2AQU2WEyyvByeanLn+Y +0khQYosr0Ig1ReiQMO3sv+bhhLrvQc+sLbNl8S0IDi6ZHfZMlNR6hpi+k/XwGDNULnvGOdWi+Gyh XJbB75hTGPMAi9z+r0bOAlDbxqBUGnLUtacA==; Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.97) with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1sEXeq-00000000QKx-0xdT; Tue, 04 Jun 2024 19:09:12 +0200 Received: from p57bd9a40.dip0.t-ipconnect.de ([87.189.154.64] helo=[192.168.178.20]) by inpost2.zedat.fu-berlin.de (Exim 4.97) with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1sEXep-00000002hUu-48I5; Tue, 04 Jun 2024 19:09:12 +0200 Message-ID: Subject: Re: [PATCH v3 cmpxchg 2/4] sh: Emulate one-byte cmpxchg From: John Paul Adrian Glaubitz To: "Paul E. McKenney" , linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, elver@google.com, akpm@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org, dianders@chromium.org, pmladek@suse.com, torvalds@linux-foundation.org, arnd@arndb.de, Andi Shyti , Palmer Dabbelt , Masami Hiramatsu , linux-sh@vger.kernel.org Date: Tue, 04 Jun 2024 19:09:11 +0200 In-Reply-To: <20240604170437.2362545-2-paulmck@kernel.org> References: <1dee481f-d584-41d6-a5f1-d84375be5fe8@paulmck-laptop> <20240604170437.2362545-2-paulmck@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Original-Sender: glaubitz@physik.fu-berlin.de X-ZEDAT-Hint: PO Hello, On Tue, 2024-06-04 at 10:04 -0700, Paul E. McKenney wrote: > Use the new cmpxchg_emu_u8() to emulate one-byte cmpxchg() on sh. >=20 > [ paulmck: Drop two-byte support per Arnd Bergmann feedback. ] > [ paulmck: Apply feedback from Naresh Kamboju. ] > [ Apply Geert Uytterhoeven feedback. ] >=20 > 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(+) >=20 > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig > index 5e6a3ead51fb1..f723e2256c9c1 100644 > --- a/arch/sh/Kconfig > +++ b/arch/sh/Kconfig > @@ -16,6 +16,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 @@ > =20 > #include > #include > +#include > =20 > #if defined(CONFIG_GUSA_RB) > #include > @@ -56,6 +57,8 @@ static inline unsigned long __cmpxchg(volatile void * p= tr, 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); > } Reviewed-by: John Paul Adrian Glaubitz I can pick this up through my SH tree unless someone insists this to go through some other tree. Adrian PS: I'm a bit stumped that I'm not CC'ed as the SH maintainer. --=20 .''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913