Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3373800imj; Mon, 11 Feb 2019 20:05:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IbHhIyav2guJgNFaYZajxFuE54TA09hV8wiL1UIgE+ly6Qvfp6IwIfCfsefEw2A/sJnSRnB X-Received: by 2002:a63:d80b:: with SMTP id b11mr1764624pgh.168.1549944323548; Mon, 11 Feb 2019 20:05:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549944323; cv=none; d=google.com; s=arc-20160816; b=SWbQgyYHkMIq/iq4z0ELozxLD/LQAFz5a9JYAL1Z7BhEeNO8/uhXghd3Yypr+JzHE4 Ak4rpu3/X9FQzXvHzCs9RyRcIedP86XrSgJStH34lKC1gMaHolPrrMDv0rgaTctI8aia XoHp164dwmlSK77mp/6mpawzf/IRpP274i09/97n1RSujQ/2V0NzPjQ5JzywHuzaVCgW okc+maBAUhD1ogP4+t0aMJ6gAYO8vy/s7hBgPKjEX3JSGCMyo2xZT3ozDJTh5qG4hsTZ B6dkj4zhfMkK4Js4NBhelCrMiBh677c+8I0gXUCjfn87DgrqHFbc80No5RWKq692z1GC ptFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=U+l3x+LwMh1erffpVMqXVXKsWVnEzV5/hRSquQ+OYLk=; b=th4ZBMGZMY9cdjcjGgsFDyv22oviPIPQsUsEqDoroVMt838O5TQ8jE+FLCXa7BA0MO o/DAdG9wiVJU1nXFGh+6MvXnRYeGIWRDxC4fwC7DSpxslNNsZu0zX/YDS0eK0lsitdnM etIwoBIitZYwNyp8X3IUV55RS4JqgJIK7WXDAfGcWTxzbQ0nZKusGEKVLDoHhmuRh3dG axYoMy26zKpX/Q1bmxgZPu3uqZufgmr9vWjIXQveMOFP9oXF2oW1ePo7hlC5BudBl3RA rbkM1ij/mDXtjqhj74497cRaBWWxTJaM4+7TDgXs/WMiiWN8JnO7YbebLCTxCAISlOiS Lgug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63si12589668pld.132.2019.02.11.20.04.53; Mon, 11 Feb 2019 20:05:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727458AbfBLECf (ORCPT + 99 others); Mon, 11 Feb 2019 23:02:35 -0500 Received: from gate.crashing.org ([63.228.1.57]:41053 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726961AbfBLECe (ORCPT ); Mon, 11 Feb 2019 23:02:34 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x1C41DlZ010377; Mon, 11 Feb 2019 22:01:21 -0600 Message-ID: Subject: Re: [RFC PATCH] docs/memory-barriers.txt: Rewrite "KERNEL I/O BARRIER EFFECTS" section From: Benjamin Herrenschmidt To: Linus Torvalds , Will Deacon Cc: linux-arch , Linux List Kernel Mailing , "Paul E. McKenney" , Arnd Bergmann , Peter Zijlstra , Andrea Parri , Daniel Lustig , David Howells , Alan Stern Date: Tue, 12 Feb 2019 15:01:13 +1100 In-Reply-To: References: <20190211172948.3322-1-will.deacon@arm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.4 (3.30.4-1.fc29) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-02-11 at 14:34 -0800, Linus Torvalds wrote: > On Mon, Feb 11, 2019 at 9:30 AM Will Deacon wrote: > > + > > + 1. All readX() and writeX() accesses to the same peripheral are ordered > > + with respect to each other. For example, this ensures that MMIO register > > + writes by the CPU to a particular device will arrive in program order. > > Hmm. I'd like more people look at strengthening this one wrt across > CPUs and locking. > > Right now we document mmiowb(), but that "documentation" is really > just a fairy tale. Very *very* few drivers actually do mmiowb() on > their own. > > IOW, we should seriously just consider making the rule be that locking > will order mmio too. Because that's practically the rule anyway. > > Powerpc already does it. IO within a locked region will serialize with the lock. Yup. It's a bit ugly but I felt back then that getting drivers to use mmiowb() properly was going to be a losing battle. Cheers, Ben.