Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2711391pxj; Mon, 31 May 2021 08:50:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoAfcw9QvYGHNt7WvkVnwHqmJAbRKx/1X71x3LV9gocz73MDlPso/gtT+1ocu0V8c83HjK X-Received: by 2002:a17:906:4e95:: with SMTP id v21mr9310284eju.434.1622476251564; Mon, 31 May 2021 08:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622476251; cv=none; d=google.com; s=arc-20160816; b=ZaYBv5TCn0fu5zr9DE0Tcxr+F8r5+Kciyzst6/0TWKSM2TCPOnsUe0u7+IWiVCxSik J1EX9pC6FtrfK0c7hNM+kUjMcprrc0VyWjpUA27UjjoHl5GRPiQJOTQZGJlA48q9bDDV /yPQPRvyjDkUcUG+eRFEobpemZGiJdke1C4f05aV+R67G5w7LjjsU1ExMoaaXqtqBHJn sZzmtUIOdUVxFpvFjWwZNWr2Hu6/PQStG24DdM3x7eklVoBLDysQJAAMK7+8Wtvllha+ uHyCXrE8zc9wmkxqL5MocKJ8+mBWzwmt2iN6SVamVPPqPlRkxQV93kSQoVUiUNM0q1se vMuQ== 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=KhRkB2vI7Y8ng90xrKSs5J9qcgviF9+ms4PnemEv7GZwmR77jbQ0qjg5kGniFRAEN8 2EzYipqNDdF/syX5MCthwMTk3AoK/+e9BNklKixX4L4jyx0o4F/bn6F+jFnAAuHIKbc9 addGbC0QDa19Cxu3KhC8CNxyqdCNuQnkFEb9ao2nArVkAQSga+b9qFFA0fTtYfvCxqGA yk+4QWUq2tv5MTvNB4TEJnFP+hWKLl4RH70i9cg3MJOD2nw6eCS1BAZqoJ3tKZZXE6FW RGBYUXoxOeD7Ox8jlgz+C7U6b5vrrHQcEsLh9DjWzMYs/r0oHuoy3i+JQI1Xfjfio4A/ sS5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oc8WP5Gs; 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 w21si13482242ejy.240.2021.05.31.08.50.28; Mon, 31 May 2021 08:50: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=oc8WP5Gs; 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 S231240AbhEaPsq (ORCPT + 99 others); Mon, 31 May 2021 11:48:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:56128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233712AbhEaO11 (ORCPT ); Mon, 31 May 2021 10:27:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C6AA61607; Mon, 31 May 2021 13:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468850; bh=eThF42QgHM2ceyuUbfHXSeQsf1W1pocY7rix57lF/sE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oc8WP5GslnIZ4qHriGAg5OYTUjyJomUBTVJVE+D01tR1wcfa+CD5VHxIL8DmD/TT9 zZ5tmTHJL27JgWq/hZE6YCjZxqNJPmbQyrIMBzscoIo7A5o90x11mZC/TQbIIMLzVX YE79krSE5DBVqQCdUSXAkfeUP33Ho5aZA5NeJxII= 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.4 125/177] openrisc: Define memory barrier mb Date: Mon, 31 May 2021 15:14:42 +0200 Message-Id: <20210531130652.245455529@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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