Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp494131pxf; Thu, 11 Mar 2021 08:13:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwD4hwTrfNdtX5P7vzjn6xVlArX54rpCKd1WFw/GykPVsDuJWrnQto2kg50UMhdPHcbfnyn X-Received: by 2002:a17:906:1113:: with SMTP id h19mr3753073eja.478.1615479200159; Thu, 11 Mar 2021 08:13:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615479200; cv=none; d=google.com; s=arc-20160816; b=G2kRB1IxuSf2cLvh45d3PVfG7IJUb4c6ulg9GgdwcG5pZsSbpBQb8NyynuC8KU0x1P V5y443BIVqjMbth0nQg93SsQoNS2NStBkxEy5wkuyBAYRKBfla9rJJdI1w+jOONL88LR jx6ocRjMJTU7ZGhn0DK4+fco7oyn28T2XupcCPBg46W+ZM9y9oq/9Pa6j922SQDpbeZf zv+beraEPAoOxkOiqO3JfcCUDYFPt33cYyXa8vnA1QA+Q9FphH4UNtlBYbR4bQYI6BaG AOwyablvv/yTDXllkyXJDZYT1sbL8zaTYYGqOARTSaju6FSkCgrm75INxn0QZ49JIJVN viug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pXOvTZ1IokKP8QFCkV6oDbP4OXAUL6e86ROIq5Qy/N4=; b=A7px620ZfS5Ucadvbv4KKumOQqk+bZdUHZDlaJPaNVX1NYX2r/ZGKQ4Jbqip3JuAmH fC11cGYFKheJG6qZNK7eXjsyCh3CeV3j6Ph5UIu+BWMwtMP674nZMBFV64eQjPtCiZAL nQ/ZTVkNChD0wOR9F2T0yrfQwqzTW3k2kiVG4UdKVPEkUpoKFHvtBAISif139GJ45gqV Dm30zmPiy+JIAgk8gkec690S5wfe6X+FcseMOCSIdfdKyH73M0IE2hGfqeItiPnk5Dxm 7Pb/fP0oLoqWhQQqD9qCaDfQ1gwmh8oN61xoO3t7t2REiapGOYcx2HyojerwXtFudCIP 9bBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rZMT6a20; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sa7si2146853ejb.49.2021.03.11.08.12.57; Thu, 11 Mar 2021 08:13:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rZMT6a20; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234287AbhCKQIL (ORCPT + 99 others); Thu, 11 Mar 2021 11:08:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:49616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234251AbhCKQHy (ORCPT ); Thu, 11 Mar 2021 11:07:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 324B064FE0; Thu, 11 Mar 2021 16:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615478873; bh=pXOvTZ1IokKP8QFCkV6oDbP4OXAUL6e86ROIq5Qy/N4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rZMT6a200ZkKFIlC64Y95Lh3CoGbWKVA2aLSJkPb2X6OXLMM0NAuzEyiJxE5qtz6Q 2x3xdSfRZ0/MgYjjuEM0VymM6kzq8k6XmaRcfps/Rki3AC8up5cTQyG5u1XC6gUdYJ 1PfVCUvGYd1A9vvqVkt1HwbCfRdHz2fhLyTY091zzEOsWSKKhvPdBVEWOFCm5u0o6r V2NGMQ9BkbxtETNLle012GrRgOvuiN0rFIW5pocXoXxLRSv26uwvdRdPpUXFKs2e2P jIvGl9CCnf1te4crIJSI1VPWMomudF01F835zyKfB/N5UDaieiPZNoKX2Ulm23vE0S Pby9egD1kUo4Q== Received: by mail-ed1-f45.google.com with SMTP id o19so3567770edc.3; Thu, 11 Mar 2021 08:07:53 -0800 (PST) X-Gm-Message-State: AOAM530HGztStma8XYK1lQkj9QiG8zjRmmbjIqAk5+8njKTjP7sab/VV cC9Y8MOFRDrekNuz0YUN2QbygHt7x9zZRNhFMw== X-Received: by 2002:aa7:d385:: with SMTP id x5mr9353487edq.289.1615478871516; Thu, 11 Mar 2021 08:07:51 -0800 (PST) MIME-Version: 1.0 References: <20210304213902.83903-1-marcan@marcan.st> <20210304213902.83903-13-marcan@marcan.st> <6e4880b3-1fb6-0cbf-c1a5-7a46fd9ccf62@marcan.st> <20210308211306.GA2920998@robh.at.kernel.org> <332c0b9a-dcfd-4c3b-9038-47cbda90eb3f@marcan.st> In-Reply-To: From: Rob Herring Date: Thu, 11 Mar 2021 09:07:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted To: Arnd Bergmann Cc: Hector Martin , linux-arm-kernel , Marc Zyngier , Olof Johansson , Krzysztof Kozlowski , Mark Kettenis , Tony Lindgren , Mohamed Mediouni , Stan Skowronek , Alexander Graf , Will Deacon , Linus Walleij , Mark Rutland , Andy Shevchenko , Greg Kroah-Hartman , Jonathan Corbet , Catalin Marinas , Christoph Hellwig , "David S. Miller" , DTML , "open list:SERIAL DRIVERS" , Linux Doc Mailing List , linux-samsung-soc , "open list:GENERIC INCLUDE/ASM HEADER FILES" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 11, 2021 at 2:12 AM Arnd Bergmann wrote: > > On Wed, Mar 10, 2021 at 6:01 PM Rob Herring wrote: > > > > On Wed, Mar 10, 2021 at 1:27 AM Hector Martin wrote: > > > > > > On 10/03/2021 07.06, Rob Herring wrote: > > > >> My main concern here is that this creates an inconsistency in the device > > > >> tree representation that only works because PCI drivers happen not to > > > >> use these code paths. Logically, having "nonposted-mmio" above the PCI > > > >> controller would imply that it applies to that bus too. Sure, it doesn't > > > >> matter for Linux since it is ignored, but this creates an implicit > > > >> exception that PCI buses always use posted modes. > > > > > > > > We could be stricter that "nonposted-mmio" must be in the immediate > > > > parent. That's kind of in line with how addressing already works. > > > > Every level has to have 'ranges' to be an MMIO address, and the > > > > address cell size is set by the immediate parent. > > > > > > > >> Then if a device comes along that due to some twisted fabric logic needs > > > >> nonposted nGnRnE mappings for PCIe (even though the actual PCIe ops will > > > >> end up posted at the bus anyway)... how do we represent that? Declare > > > >> that another "nonposted-mmio" on the PCIe bus means "no, really, use > > > >> nonposted mmio for this"? > > > > > > > > If we're strict, yes. The PCI host bridge would have to have "nonposted-mmio". > > > > > > Works for me; then let's just make it non-recursive. > > > > > > Do you think we can get rid of the Apple-only optimization if we do > > > this? It would mean only looking at the parent during address > > > resolution, not recursing all the way to the top, so presumably the > > > performance impact would be quite minimal. > > Works for me. > > > Yeah, that should be fine. I'd keep an IS_ENABLED() config check > > though. Then I'll also know if anyone else needs this. > > Ok, makes sense. > > Conceptually, I'd like to then see a check that verifies that the > property is only set for nodes whose parent also has it set, since > that is how AXI defines it: A bus can wait for the ack from its > child node, or it can acknowledge the write to its parent early. > However, this breaks down as soon as a bus does the early ack: > all its children by definition use posted writes (as seen by the > CPU), even if they wait for stores that come from other masters. > > Does this make sense to you? BTW, I don't think it's clear in this thread, but the current definition proposed for the spec[1] and schema is 'nonposted-mmio' is specific to 'simple-bus'. I like this restriction and we can expand where 'nonposted-mmio' is allowed later if needed. It's possible to express in json-schema, but I think it wouldn't be pretty. Json-schema is not great for expressing inter-property constraints and it gets worse if we're talking inter-node constraints. I'd like to define a way to do python snippets of code for something like this, but that's way down on the wish list. Rob [1] https://github.com/devicetree-org/devicetree-specification/pull/40