Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3439757imj; Tue, 19 Feb 2019 03:37:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IY8mGRzg/DGXKd88ZSDvzAfD3iAqGlWnxP8vVsE9xbBjjL0fgZLk2qSbQ9la1WA1Gr+5FfC X-Received: by 2002:a63:1544:: with SMTP id 4mr23879244pgv.290.1550576233108; Tue, 19 Feb 2019 03:37:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550576233; cv=none; d=google.com; s=arc-20160816; b=AsMUTM2bLCIEJYtE+ja2RpkbJeFgky1bly0t+6lDCR5OWntgBNvfX2BXYl2WrTmB1o IXVprBuQ6CfTd61320r7rG4qd/SLAQIu8p5Hx6ed53kmHVjEolyqjwLMgEx5aifckAtx zbtGgNs62S5KjXnRkvK9or9a4DIJazOpdM+VnugOeAsEEaZM3Y4CNu65fP7gokUPT1Sv jP0HFIi7U1uyWjfkFAAPbp8K+aIeQO2dn/hVpScxvaIIgHaNvx4nAWaU8+IY+acHy1Gd zLGJ4gjdHxw812kio11xwVOE5gFDwEuAA77zSZz4cXQObAl0xw2h8ikppCcM18XNFQS8 hy8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hj1Xe/Nn0UdnvK8IB3LZlVEfljEhkrtTg0iNNmL9y60=; b=sxhK7adyOqfb+eTYj80B4qha0GcQnAovH++jH49dhnBmb2U+hfqC03uMFRijc8/hQ6 NfYUYOUtl0LqPHu2HkZIY5QpK1l8+H4P1mAmQ3cls3m4mqXRbV4tY4C0t3uR4WsLMQGa edkID34RXC2qHSjD8an2hXSJs1+7l5DkF5TFEw9r2ySE+ClJchBRBCcH77xwarqjgLBi HN9dzMxqdmP8L3vmUl1ZhLQB4rTMsGCKuzOJ+pzDVVRwDs64ZLbD3DmU52uIjiI9ejCa NJql1svUoDLDm6qzXW/x0bkEcs7iafw0ulGoLmdOu/hh3QWutGacztBwkpZSlTfQCfIz dXkQ== 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 f193si15749071pgc.31.2019.02.19.03.36.58; Tue, 19 Feb 2019 03:37:13 -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 S1727660AbfBSLgU (ORCPT + 99 others); Tue, 19 Feb 2019 06:36:20 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44048 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbfBSLgU (ORCPT ); Tue, 19 Feb 2019 06:36:20 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E98D8EBD; Tue, 19 Feb 2019 03:36:18 -0800 (PST) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6AA423F720; Tue, 19 Feb 2019 03:36:11 -0800 (PST) Date: Tue, 19 Feb 2019 11:36:09 +0000 From: Will Deacon To: Arnd Bergmann Cc: Thomas Petazzoni , linux-arch , Linux Kernel Mailing List , "Paul E. McKenney" , Benjamin Herrenschmidt , Peter Zijlstra , Andrea Parri , Daniel Lustig , David Howells , Alan Stern , Linus Torvalds , Thomas Petazzoni , Gregory CLEMENT , Russell King - ARM Linux Subject: Re: [RFC PATCH] docs/memory-barriers.txt: Rewrite "KERNEL I/O BARRIER EFFECTS" section Message-ID: <20190219113609.GC4027@fuggles.cambridge.arm.com> References: <20190211172948.3322-1-will.deacon@arm.com> <20190218162954.GB16713@fuggles.cambridge.arm.com> <20190218175625.GD16713@fuggles.cambridge.arm.com> <20190219112747.7db95e58@windsurf.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 19, 2019 at 12:31:50PM +0100, Arnd Bergmann wrote: > On Tue, Feb 19, 2019 at 11:27 AM Thomas Petazzoni > wrote: > > On Mon, 18 Feb 2019 21:37:25 +0100 > > Arnd Bergmann wrote: > > > > > Ah, it seems we actually do that on 32-bit ARM, at least on one platform, > > > see 6a02734d420f ("ARM: mvebu: map PCI I/O regions strongly ordered") > > > and prior commits. > > > > Yes, some Marvell Armada 32-bit platforms have an errata that require > > the PCI MEM and PCI I/O regions to be mapped strongly ordered. > > > > BTW, this requirement prevents us from using the pci_remap_iospace() > > API from drivers/pci, because it assumes page attributes of > > pgprot_device(PAGE_KERNEL). That's why we're still using the > > ARM-specific pci_ioremap_io() function. > > Ok. > > > > > I would still prefer to document the weaker semantics as the portable > > > > interface, unless there are portable drivers relying on this today (which > > > > would imply that it's widely supported by other architectures). > > > > > > I don't know of any portable driver that actually relies on it, but > > > that's mainly because there are very few portable drivers that > > > use inb()/outb() in the first place. How many of those require > > > the non-posted behavior I don't know > > > > > > Adding Thomas, Gregory and Russell to Cc, as they were involved > > > in the discussion that led to the 32-bit change, maybe they are > > > aware of a specific example. > > > > I'm just arriving in the middle of this thread, and I'm not sure to > > understand what is the question. If the question is whether PCI I/O is > > really used in practice, then I've never seen it be used with Marvell > > platforms (but I'm also not aware of all PCIe devices people are > > using). I personally have a hacked-up version of the e1000e driver > > that intentionally does some PCI I/O accesses, that I use as a way to > > validate that PCI I/O support is minimally working, but that's it. > > The main question is whether we know of a portable (not specific > to a single architecture) driver for PCIe (or PCI, but probably not ISA) > that uses outb/outw/outl in a way that relies on the on-posted > behavior of those, compared to posted writeb/writew/writel that are > only required to complete before another I/O operation on the same > device but whose completion is not ordered with regard to the rest of > the system. > > I think an example of this would be a driver using outb() to disable > an interrupt, and then relying on the the interrupt no longer happening > after the outb(). Isn't that racy already? i.e. the interrupt could fire just before you disabled it, but not get delivered by the irq controller until after you'd disabled it at the device? Will