Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp743320rwn; Thu, 15 Sep 2022 06:01:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR7uUborVPi8O8aSy6HtGfdMdmcBBulj49d2tBhySQ+kJVvpdOwn9Ci681SxcNID93y9WhhU X-Received: by 2002:a17:907:74a:b0:77e:9455:b4e1 with SMTP id xc10-20020a170907074a00b0077e9455b4e1mr12668255ejb.462.1663246884614; Thu, 15 Sep 2022 06:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663246884; cv=none; d=google.com; s=arc-20160816; b=me5odCe92oOKjI9fp6rSlJU1yMdbrgKF95C8YwynYDjWuwEYBY6QTXTWBudzTwGvGZ Q6VCJsAEegodcX3gAMK0lumWPlW+nOaG7m7AQi7udHPdZf5H49w7Zu9umifn4OfnBwZj kEws4Qu2sOhTGkv1ofwvhf9iC696ojyGM+cHxQ9jw+/3na6jBLvBqJBzVtlRGuKluCiB 7hZw9FKjYPM7+BxKPLYfor07LRjSf73k7CuXeK9+xz7AaD4APneZ57NfN4lPhjaU97Sd qw+AZ/JZ2mN/QKKVMgnXw3ZJdSJuLHYljOk6oWcgMJqV1tcunzMWJOGAFuuHbWwfmShW WHAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=GOQu+p1fdWE5Hvw9mjSrByv4wqlK2YtuqQuIjWmQzbM=; b=PVcLLeW+gTZadEHXt+Occ38dgSozpxQksjgSkidMFntvXgZlpOaUE9Viwf/fpPm+Dh ADtFRAq4Oas3573IVG9UNKEeD9U2MpPyWXTQ6dwKLHtsADi0XEp0+jSGZ3zyKWje/5Oh MqUNxcQme57602/EeCMVYOhji2fF8javMCIeZ+2plKNVBiDSfeDUjWDsMPl8ODR9b8s0 4gP1mE8Dsoc0QIG6Ptat0zvTkYVR+Riokzoy8sC3efxRPAV8e2r+VQqycz0/xvsKKWhG TyB76CBPhO0yXOpw2of80vboFNG3qMqWgXJnXQaYwRYfmRIwuqO/Qaru5CWlX4hq2jGc 336w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=iK5aPwGs; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XaP2Sxmo; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di22-20020a170906731600b0073d68aa1384si15054965ejc.185.2022.09.15.06.00.53; Thu, 15 Sep 2022 06:01:24 -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; dkim=pass header.i=@arndb.de header.s=fm1 header.b=iK5aPwGs; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XaP2Sxmo; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229663AbiIOMiZ (ORCPT + 99 others); Thu, 15 Sep 2022 08:38:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbiIOMiX (ORCPT ); Thu, 15 Sep 2022 08:38:23 -0400 Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C26327E81B; Thu, 15 Sep 2022 05:38:20 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 2E87B580A3A; Thu, 15 Sep 2022 08:38:18 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Thu, 15 Sep 2022 08:38:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1663245498; x=1663249098; bh=GOQu+p1fdW E5Hvw9mjSrByv4wqlK2YtuqQuIjWmQzbM=; b=iK5aPwGsVp4LFDgOT6v1vOcJXd v2t8uJQju2i8NkEtKrotkc5at3C7vkyEkNUUxz9B82lUwXv7Lr21VT80tZNk6Xg0 VRUNf0hJD0plBl1FZ5GNRUtEqIwjfFhYH6YW1ePT91pqrlvLL+KGgT89uA9hxfn6 y/08rc0ujo57MH7A18qUiPKHanmiiEVUS+YH4kezjtMvb680f/DDVV+g4ZUyIKQF G+8ELEfkrpp9D9oh46zsXllUYrXMC5N+wCJXgEzOA0k0mxgByf2UcCBISBR/xyim HR87b5q8kR/eRvt6H06SHTiTX6L0WAboqXD460/6N0lIuurIpQ/aXNFpRHng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663245498; x=1663249098; bh=GOQu+p1fdWE5Hvw9mjSrByv4wqlK 2YtuqQuIjWmQzbM=; b=XaP2SxmoImcj1BJ6jg8g6fEGc6KHKH0i4XzjSPePeibz wZwJE85YQWmeqJeFt25ucs8DVPCn4dDPa1/zkBlnTXJLa+V6CNhcZRSOI0TEpwhA GzICWSWNfPluom+CS1n8uoEzUs6YOUouK+x+auOp4GJxMAqFCx3F+gIxfFrAao7l bI6qVKdN1+VIslJf/FV3mxocas2V9/2nfiWksIwRSfJWzitRtJrTLOKoB7FGL+EX LTdB6SDyV8+n5Qiv70X6A8yHCmG+6Ks7xS44poXj+NO1UANnO7uID7gtTHKu9nMj MYZ4+v+XA8xhFq/2uDZMtGVBPM5pgY7lPEQhofEKkQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedukedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffgeffuddtvdehffefleethfejjeegvdelffejieegueetledvtedtudelgfdu gfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9768BB60089; Thu, 15 Sep 2022 08:38:17 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-935-ge4ccd4c47b-fm-20220914.001-ge4ccd4c4 Mime-Version: 1.0 Message-Id: <96457b14-e196-4f29-be9a-7fa25ac805d9@www.fastmail.com> In-Reply-To: <20220915050106.650813-1-parav@nvidia.com> References: <20220915050106.650813-1-parav@nvidia.com> Date: Thu, 15 Sep 2022 14:37:57 +0200 From: "Arnd Bergmann" To: "Parav Pandit" , stern@rowland.harvard.edu, parri.andrea@gmail.com, "Will Deacon" , "Peter Zijlstra" , boqun.feng@gmail.com, "Nicholas Piggin" , dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, "Paul E. McKenney" , akiyks@gmail.com, dlustig@nvidia.com, joel@joelfernandes.org, "Jonathan Corbet" , linux-kernel@vger.kernel.org, Linux-Arch , linux-doc@vger.kernel.org Subject: Re: [PATCH] locking/memory-barriers.txt: Improve documentation for writel() usage Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS 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 On Thu, Sep 15, 2022, at 7:01 AM, Parav Pandit wrote: > The cited commit [1] describes that when using writel(), explcit wmb() > is not needed. However, it should have said that dma_wmb() is not > needed. Are you sure? As I understand it, the dma_wmb() only serializes a set of memory accesses, but does not serialized against an MMIO access, which depending on the CPU architecture may require a different type of barrier. E.g. on arm, writel() uses __iowmb(), which like wmb() is defined as "dsb(x); arm_heavy_mb();", while dma_wmb() is a "dmb(oshst)". Arnd