Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1954013rda; Tue, 24 Oct 2023 08:08:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFebnLk32a3bi4I2vf1IjvD3H13qq1R0D5wi5q9snfapRoGQncMERJKdNSqldat3TCMzlN/ X-Received: by 2002:a05:6a20:430e:b0:151:35ad:f327 with SMTP id h14-20020a056a20430e00b0015135adf327mr2953855pzk.17.1698160118191; Tue, 24 Oct 2023 08:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698160118; cv=none; d=google.com; s=arc-20160816; b=po0vZArnNizVzapTFwkRpdZqsI42LJeDyF02L2iagdvhGpb/8IxrDlutlrRgbVSDTo YiYrYD9Xsdh0S/5BGTcpAhmB5jNbRqBy08DTHsVKVTte68Nh3zzTCHJchr9NoDCPGPRh zR2T9ffzJDkbLn66Ktufyt6JcNuJsr7BkUrz+Z8LnUtbMqsLiKWC6K/m0gzbc5GNgLav YcbNNlVqj4aTilyurndxFaiZoAuV4ik7GeWWHBtpBnn1JyLnXwTN+5lyPBege+Knq+gj n3ffFYN8kUYf61SRE8uOvl1iLBU+WZNn21PCE3Ru8kCMdmQmt7QucqRlDnCYOwyhOF2o 8ELA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JthxsQFIE9JwIETHuv/2aRhDHI0F7I25QkhWOUnaN9I=; fh=3i5gWl/QlYOzhqCqvbzPoIx9Bx6+dQu9hRt/cFOQJig=; b=rCHbNLWgjoLusWeIupfuwywHSngyBxoBECzikj9NN6htbrzDh6BrXFCylfu4QuN47s 8UINMk2U0t+eE5Eg0x5vmv99p+b036wnwB2wE1tqmJFZ4EJqhafC1Lhk/Q7t1RHAtLEg mYOawl0wBw2siwZRjo805S/iMS7IDdaGMuhwE8HZlc20L5EpD3gvnkhcr34hUDuL3v0r JztUVaZXG7Uy5RLmq988LV+TJWwX50pmSMR4hkar6IVKUszFUlI/vK7FXiP2544456xF 3qhMH+fGaRHhEb7JqTxyE5/3BE8gSbT/yVMaBPjlOKXnSIwxyWeHy6Ra73d/DQ+XfcGY LpMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id d38-20020a631d66000000b005781e99d048si8390388pgm.889.2023.10.24.08.08.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:08:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2CC48802E8BE; Tue, 24 Oct 2023 08:08:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230059AbjJXPI0 (ORCPT + 99 others); Tue, 24 Oct 2023 11:08:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjJXPIZ (ORCPT ); Tue, 24 Oct 2023 11:08:25 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 446B9BA; Tue, 24 Oct 2023 08:08:22 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 91BA32F4; Tue, 24 Oct 2023 08:09:02 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.29.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AD0633F762; Tue, 24 Oct 2023 08:08:18 -0700 (PDT) Date: Tue, 24 Oct 2023 16:08:12 +0100 From: Mark Rutland To: "Masami Hiramatsu (Google)" Cc: Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "wuqiang . matt" , Peter Zijlstra , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH] locking/atomic: sh: Use generic_cmpxchg_local for arch_cmpxchg_local() Message-ID: References: <169815917362.8695.13904684741526725648.stgit@devnote2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <169815917362.8695.13904684741526725648.stgit@devnote2> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:08:32 -0700 (PDT) On Tue, Oct 24, 2023 at 11:52:54PM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Use generic_cmpxchg_local() for arch_cmpxchg_local() implementation > in SH architecture because it does not implement arch_cmpxchg_local(). I do not think this is correct. The implementation in is UP-only (and it only disables interrupts), whereas arch/sh can be built SMP. We should probably add some guards into for that as we have in . I think the right thing to do here is to define arch_cmpxchg_local() in terms of arch_cmpxchg(), i.e. at the bottom of arch/sh's add: #define arch_cmpxchg_local arch_cmpxchg Mark. > > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202310241310.Ir5uukOG-lkp@intel.com/ > Signed-off-by: Masami Hiramatsu (Google) > --- > arch/sh/include/asm/cmpxchg.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/sh/include/asm/cmpxchg.h b/arch/sh/include/asm/cmpxchg.h > index 288f6f38d98f..e920e61fb817 100644 > --- a/arch/sh/include/asm/cmpxchg.h > +++ b/arch/sh/include/asm/cmpxchg.h > @@ -71,4 +71,6 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old, > (unsigned long)_n_, sizeof(*(ptr))); \ > }) > > +#include > + > #endif /* __ASM_SH_CMPXCHG_H */ >