Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1402670ioo; Sun, 22 May 2022 13:22:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7/HtLWOKeoctPH4guE6TpkdA2ICWGzkP2RJmoN8ARrbo8a+NtVmVBHynbVNfFLMOH84zg X-Received: by 2002:a17:903:22c7:b0:161:cf2e:2ce2 with SMTP id y7-20020a17090322c700b00161cf2e2ce2mr19872274plg.59.1653250967306; Sun, 22 May 2022 13:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653250967; cv=none; d=google.com; s=arc-20160816; b=FGkCd8xse7pUzukmTkgzaIe2Vly/Jzhb5Qo9MSMqAHZLScPH9xs4bOJY/Wo2apOm0C bHmCdjMGg7ILTuriIThfhjP0eKCh6FMO3SZbbPLUXJw0r8YQ7VidL0eUHri0u5w0Fd1i zPuuWrmbm6Zz8200wVGlneeBRzdFD0Qkpg3AnOeu2ux0vZOt8LGs+lJhTLwjW/JLp515 sNUEWndpdOQn+kkHGGB8E5Qu/DBkOpPvXjaB3o1wG77jBB+TW9tl6fc2n1RXE57qs4hA sl9CRYFS2Pr1OrhNVdoBzrOGGDYUdaCXjO6qdfI/hniR+oU0QvyOc4N3PYoPaBXx8f3k K3fA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=y85gn1bk8mwJNOKZuiim5Bcn2mbhAxm8td72CcQKX6M=; b=c8G3SN8fUqSGNZTWqFaQ1yiytXK1I+6d8dwrx4+9OD/H6oftB6xYmkV7nXwb/gX3BV e2lf0u+L+aRHm7I0W7R0s9YUbFTlUV+MeyjN8skvTq5Ajkr2FjbPZA9D/2f9xB0f7mIM A1lRlTPDWmxCXRgkR9icupxfw7q5GgOMReM5XX5fDTKYSrxBg7naymqGEsjP42HJXDV/ h80ZkgKbpx56PpG4iCS2UHdvNL9cFJ1XHJhkSTlYCZQ2CTl1dtyBW3V31ZUq0NpJcSsI SG4dsl/gXQUvvOItQTWh6knrlUbLH6FBiw5BfS/8GOeQ6Nvp/pPaxpWCCLy+/lJpUO9o Sqjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a056a0024cc00b0050d8195100bsi7813142pfv.7.2022.05.22.13.22.35; Sun, 22 May 2022 13:22:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243933AbiETDFU (ORCPT + 99 others); Thu, 19 May 2022 23:05:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344969AbiETDFR (ORCPT ); Thu, 19 May 2022 23:05:17 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50BA8B82F8; Thu, 19 May 2022 20:05:16 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L4BPz0vfxz1JCQW; Fri, 20 May 2022 11:03:51 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 20 May 2022 11:05:14 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 20 May 2022 11:05:14 +0800 From: Kefeng Wang To: , , , , , , Jonathan Corbet CC: , Kefeng Wang Subject: [PATCH v2 1/2] Documentation/barriers: Add memory barrier dma_mb() Date: Fri, 20 May 2022 11:15:47 +0800 Message-ID: <20220520031548.175582-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220520031548.175582-1-wangkefeng.wang@huawei.com> References: <20220520031548.175582-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The memory barrier dma_mb() is introduced by commit a76a37777f2c ("iommu/arm-smmu-v3: Ensure queue is read after updating prod pointer"), which is used to ensure that prior (both reads and writes) accesses to memory by a CPU are ordered w.r.t. a subsequent MMIO write. Signed-off-by: Kefeng Wang --- Documentation/memory-barriers.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index b12df9137e1c..1eabcc0e4eca 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt @@ -1894,10 +1894,13 @@ There are some more advanced barrier functions: (*) dma_wmb(); (*) dma_rmb(); + (*) dma_mb(); These are for use with consistent memory to guarantee the ordering of writes or reads of shared memory accessible to both the CPU and a - DMA capable device. + DMA capable device, in the case of ensure the prior (both reads and + writes) accesses to memory by a CPU are ordered w.r.t. a subsequent + MMIO write, dma_mb(). For example, consider a device driver that shares memory with a device and uses a descriptor status value to indicate if the descriptor belongs -- 2.35.3