Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3517451imj; Tue, 19 Feb 2019 05:02:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IYPbuIEczTTBhXYHSa2Djo9UTRmbinvXx68ymjD/NVw+79oc936J4sTikjicCiYjZu14A2x X-Received: by 2002:a63:d70a:: with SMTP id d10mr23656306pgg.286.1550581370056; Tue, 19 Feb 2019 05:02:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550581370; cv=none; d=google.com; s=arc-20160816; b=tkQoUQMjIWmo2/SYjsvepk61Wef60s1hE4q8Gkw5lS7ZtkKYGZKvB0OVclSJVGWgH3 +HGZlisdNt2Kw/O9qTzgmIw83Vr/n2CRWslAQza4vDWNVVvKU4TgXOZuOLKxLWFSDyTn BtfS/Yqx3IxJOr47B1OdJeP6e52cJ6i0OpZVt2z79cTyhyAwqTFL8K6JucWua3XuEHqY TSTIJYRewp6SgHS6rGqdsbGh+bqQKyiobca2m0xy84vg0EZ1su0GWlhxvynoWis6gry4 qHgxtFA0XPpOPdzyHo0XOwiKt8fFwLSoAYVxd6o2SPupTrjD6S5XNK6oZUOgXS14BWiU IfgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=BdqjMlHllaQgH1N6KZKsajlALVR7GNWBr+8I5nZAir8=; b=NaNhG8zY7DeotOTFFbUXqxHkvLhXECQ3xw1H1K1fXJMrVwnjBXMlkYogskRfWhLIN3 L9XlgPFtw/0oakK7AMx1UjgrfYhyRUcsmmtKatgj9+L+5XcwtGubhWRko50INHgLeTLn sA/y5QzeuJ5cx4OxOYnfB9dPyvYXokV0uZOtJ9fTa+j8F40vyqEbnOenB/lWkEMIUmiD jy+Ja7XZhs5Ii2TeOFJpDzQnmRyBymuifLeTKYkVcJt8CjmqOPMWFvQGitLjGkX8eFR0 MnR4hgilJJ17Fg62vMUMoaH/BbU+1ey4rEGS4Hu5FoDKvFQmjizkolrJgC+Qu63EWiio iKBg== 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 r135si14143095pfc.123.2019.02.19.05.02.32; Tue, 19 Feb 2019 05:02:50 -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 S1728064AbfBSNCJ (ORCPT + 99 others); Tue, 19 Feb 2019 08:02:09 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:37064 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbfBSNCJ (ORCPT ); Tue, 19 Feb 2019 08:02:09 -0500 Received: by mail-qt1-f195.google.com with SMTP id a48so22953653qtb.4; Tue, 19 Feb 2019 05:02:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BdqjMlHllaQgH1N6KZKsajlALVR7GNWBr+8I5nZAir8=; b=KX1N2jJCR2Lu2J+8T1CDxNrnDDmMtYDwmRg/rh1LVt0zImsFGENLOqlqCTptz8J7C0 XfdwAgmGcFr32MHjaECly611NV2DoRZIjXizkCEtSn4jVH9qbSYctT+UAFdZnIoNM2OO zn1UTT52FRYcKnZ/Y2z8Dx4opqYGJIEHBw6LYFEnDLm5RsQQ+cEk1iOMagT90OpPo1LV LJUE6WQKvg0bHZfJsqh/avIE0GX/3ey0QF4o1Dv4GzX6zi7JjdumpzL6IkE72H7JkCJF xpwK7sOgQHrLcUmlewd4tAxDzrAoF9WDyHEJNzlOMKmbsD0BnAG6cIwXrv5p1Mbbza3u +3Eg== X-Gm-Message-State: AHQUAuZYMPCrThiZ1qJh2MYyODI7O9/n4Gvy57ETZ1ot3goqBMzeSnty 4dJLQkUyMz/GElnTpUVmAio15qnEpoemxLoMggc= X-Received: by 2002:a0c:98c8:: with SMTP id g8mr21709729qvd.161.1550581327610; Tue, 19 Feb 2019 05:02:07 -0800 (PST) MIME-Version: 1.0 References: <20190211172948.3322-1-will.deacon@arm.com> <20190218162954.GB16713@fuggles.cambridge.arm.com> <20190218175625.GD16713@fuggles.cambridge.arm.com> <20190219112747.7db95e58@windsurf.home> <20190219113609.GC4027@fuggles.cambridge.arm.com> In-Reply-To: <20190219113609.GC4027@fuggles.cambridge.arm.com> From: Arnd Bergmann Date: Tue, 19 Feb 2019 14:01:50 +0100 Message-ID: Subject: Re: [RFC PATCH] docs/memory-barriers.txt: Rewrite "KERNEL I/O BARRIER EFFECTS" section To: Will Deacon 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 Content-Type: text/plain; charset="UTF-8" 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:36 PM Will Deacon wrote: > 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: > > > > 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? Probably, I had a hard enough time trying to come up with any example ;-) One reference to non-posted transaction in a comment is in drivers/net/ethernet/dec/tulip/de4x5.c: /* ** The DE4X5 interrupt handler. ** ** I/O Read/Writes through intermediate PCI bridges are never 'posted', ** so that the asserted interrupt always has some real data to work with - ** if these I/O accesses are ever changed to memory accesses, ensure the ** STS write is read immediately to complete the transaction if the adapter ** is not on bus 0. Lost interrupts can still occur when the PCI bus load ** is high and descriptor status bits cannot be set before the associated ** interrupt is asserted and this routine entered. */ I found another comment in the via-rhine driver: /* Beware of PCI posted writes */ #define IOSYNC do { ioread8(ioaddr + StationAddr); } while (0) this one is used in the chip reset function, and in the transmit path. Arnd Arnd