Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2745977pxj; Mon, 31 May 2021 09:40:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx45YbO+khu0us1wfRCuL8DElTG7ZIJHoJe+m0me0S71moE7Buly4qA1NsPFPTksmwDCPGf X-Received: by 2002:a17:906:5d0a:: with SMTP id g10mr23431247ejt.349.1622479251833; Mon, 31 May 2021 09:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622479251; cv=none; d=google.com; s=arc-20160816; b=nFn952AVlUjsnDaU7od+rXF7FRLtx1JrNFW6G779aDT3adgryV2TGj06X/rrmbHQl2 9DQLdpDCFILPpcFVQQreTx9VrtGM1S81amUkMQCX7IXUBE6tQbSfHFuv4A6xSpmYguDc 9YCgx+u/mPGgVlWLoC4SJVCrKs0jckX/7ForYOw5MtePtfx2i3Vjt+BKPiJJ0CWc4w9f rKxOoWgEVp6P7C1OCCvCwz2lX2M4340Qb0phaiRS1bsUHGR7UjKN9v82cDcRA5FxXVUX Niq9v6Nw+J8PwXzehKxQBByB5EJVGO5JN18uGgC7Dy8EZFDfkQVBoMkL+0dEH+wgniKr sv7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DTcRl4SBoEJXZ0M9tEbg9q0OXGey1116eVSiddy/Iio=; b=K0iJZ19peJZR5gkOxGzS2UIIBKGlc6WOeJazjOzoRCj++2FoucIuk8idXl8r+tA2rl HcQ6jFBTUh6FpiJUFGslpVuv/iHt+9oCcAuHH4s6mrtukrLjM5WrGFQ+E3WevuqImFWZ 6oGXiGjl49gp0li/+4DKceCcLDSPpmRO5O1Yi532LwsRfB4XSMEWAOSnvwiH2shbmr9J btGRMKrTv2jLdKEOHB6e3/oDiaAhEVZ49/5muic1093I6AVMkEcjcZk73vLSVALL8hvT RaWvvc9kV042fmwuskPCziW07XIxaDKhZhzEC1XcrOOAwjhJbTitHpGeofC+OZEGm1mv ZU4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Y4vcOrO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si14439408edf.285.2021.05.31.09.40.29; Mon, 31 May 2021 09:40:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Y4vcOrO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234747AbhEaQj2 (ORCPT + 99 others); Mon, 31 May 2021 12:39:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:45320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233192AbhEaOvQ (ORCPT ); Mon, 31 May 2021 10:51:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2F17B613FA; Mon, 31 May 2021 13:57:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469455; bh=eThF42QgHM2ceyuUbfHXSeQsf1W1pocY7rix57lF/sE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y4vcOrO/+Y89P917mIAZja4ZpUXiJMXrXthGvRP/v/9fwxfj8p44zxT+MTPKzmkpn 6mWtLbj7Nst4jfOZdBUJ8tALTxSwPvnZZQJCwUMoxAnsy0fB/ghIFsaQnkufbF64Nz nNyX1+hdXZc6tbNxjKNGOQMbvwgR5nfjFbwnsMeo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Zijlstra , Stafford Horne , Sasha Levin Subject: [PATCH 5.12 203/296] openrisc: Define memory barrier mb Date: Mon, 31 May 2021 15:14:18 +0200 Message-Id: <20210531130710.705130095@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra [ Upstream commit 8b549c18ae81dbc36fb11e4aa08b8378c599ca95 ] This came up in the discussion of the requirements of qspinlock on an architecture. OpenRISC uses qspinlock, but it was noticed that the memmory barrier was not defined. Peter defined it in the mail thread writing: As near as I can tell this should do. The arch spec only lists this one instruction and the text makes it sound like a completion barrier. This is correct so applying this patch. Signed-off-by: Peter Zijlstra [shorne@gmail.com:Turned the mail into a patch] Signed-off-by: Stafford Horne Signed-off-by: Sasha Levin --- arch/openrisc/include/asm/barrier.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 arch/openrisc/include/asm/barrier.h diff --git a/arch/openrisc/include/asm/barrier.h b/arch/openrisc/include/asm/barrier.h new file mode 100644 index 000000000000..7538294721be --- /dev/null +++ b/arch/openrisc/include/asm/barrier.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_BARRIER_H +#define __ASM_BARRIER_H + +#define mb() asm volatile ("l.msync" ::: "memory") + +#include + +#endif /* __ASM_BARRIER_H */ -- 2.30.2