Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3438007imj; Tue, 19 Feb 2019 03:35:11 -0800 (PST) X-Google-Smtp-Source: AHgI3IbfeO2BB608hNSOeZSgKPcHIxE4YXx2yM4qao7acXKasNAy2gxTtt31LxnyY9rB+Ne+Tfc2 X-Received: by 2002:a65:5142:: with SMTP id g2mr4949210pgq.149.1550576111012; Tue, 19 Feb 2019 03:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550576111; cv=none; d=google.com; s=arc-20160816; b=pKIsLPyOqUhxca7B8TgPxV1v9dNjNUVlDYyRQLpi5g4/a/oYf8uMS5zW9kPKSynb0V 1e/k13MjxF9syhBoene3UV2qOA5SwhoOheiYbGKhwJkLHLbN9n+3hU8uyHa6K7YA2L5P JAz4PgT0/s3q3lBzOYA7zXiyuk2y5svjNyYZwi21/3wUjq0kT/JSZmj5fJMwYCK0CHG/ I3FVaem62o/aIN6PQmuEfwAKmIxSx15hxC/XRpcVHJtSyPZwkkHLsNrZ0vTmSj4O3Lyr KAml6Cj60V+l8Y49qel7Buq6GzFbcClt8+X3gznWhJOyzOjpRbBzXaFiijEuSHisrFqY 7C3g== 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=EE4pveeFpTHJ8ZIGu2or67JVWOHCmcEO9ENrT6Gj1k4=; b=fiQI7FMDI6HPuMdSzcG1O5Fmx4FFNq9lteQh0tZsFV9Gkzs8bqW+Z3NuUiU0u3fZk5 h0WIb5xJ3Ra9k1dMuDd3hJKhzmByy0RiscL+mialeVFt7ETZmy35jwU0kJY65qBEpXy7 AGiEIiudFgq2jJRcuCtfXH9V0RbTpXVJ0OnWdFDrLdhJEyOAywVrg52DjNXZUQxgDmP2 lBA5etwclQlIQZgBfjCFTpAeYBHAhmvOX0aOfDyiDFyTDF7vx1JJUoWWJ9oOfKWKVKuU q30YOGBLjEGlYbnb7wQyxTFjUM3zzgUsbo5r8ECWA8RrFdQAOT9j74/q+5bOfZXehYOy rmqw== 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 e65si5412386pfa.80.2019.02.19.03.34.55; Tue, 19 Feb 2019 03:35:11 -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 S1726947AbfBSLea (ORCPT + 99 others); Tue, 19 Feb 2019 06:34:30 -0500 Received: from foss.arm.com ([217.140.101.70]:43998 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbfBSLea (ORCPT ); Tue, 19 Feb 2019 06:34:30 -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 91A97EBD; Tue, 19 Feb 2019 03:34:29 -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 130163F720; Tue, 19 Feb 2019 03:34:26 -0800 (PST) Date: Tue, 19 Feb 2019 11:34:24 +0000 From: Will Deacon To: Thomas Petazzoni Cc: Arnd Bergmann , 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: <20190219113424.GB4027@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: <20190219112747.7db95e58@windsurf.home> 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 Hi Thomas, On Tue, Feb 19, 2019 at 11:27:47AM +0100, Thomas Petazzoni wrote: > On Mon, 18 Feb 2019 21:37:25 +0100 > Arnd Bergmann wrote: > > > > > I would say we should strengthen the behavior of outX() where possible. > > > > I don't know if arm64 actually has a way of doing that, my understanding > > > > earlier was that the AXI bus was already posted, so there is not much > > > > you can do here to define __io_paw() in a way that will prevent posted > > > > writes. > > > > > > If we could map I/O space using different page table attributes (probably by > > > hacking pci_remap_iospace() ?) then we could disable the > > > early-write-acknowledge hint and implement __io_paw() as a completion > > > barrier, although it would be at the mercy of the system as to whether or > > > not that requires a response from the RC. > > > > 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. Ah, I think I vaguely remember that. It was to avoid a hardware deadlock, right? In which case, I'd rather consider this use of strongly-ordered memory an exceptional case as opposed to a general property of I/O mappings. > > > 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. It was actually even more subtle than that! The question is whether outX() is relied upon to be non-posted in portable drivers, because at the moment it's typicall posted for arm/arm64 systems, with the exception of the Armada erratum above. Cheers, Will