Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp915431imi; Fri, 22 Jul 2022 12:27:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uVoKWV+2OfthIEmKYW6Gi5xs3lU5x1JFPpyyt5dIdVKLBdKyL2FVORPKxpzzb16TlYM28G X-Received: by 2002:a17:903:11d1:b0:16c:defc:a098 with SMTP id q17-20020a17090311d100b0016cdefca098mr1351574plh.50.1658518063969; Fri, 22 Jul 2022 12:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658518063; cv=none; d=google.com; s=arc-20160816; b=zIYoMnxCXGSSsAMtCJeW1CEm1PscuuUx+2NC8Dq5R1PxAKm6Bd8x1mkFX3aRDogggf /4eYWxCbSJ2d49O6MvnoQzPvBtQoBLI8etdJiIQ3BVPazJnX2Xpfq0/u4ZcVABiJN0PI bE2qYQbdhRkByNFAxSAeIXULnuI2n6zwDQtjV/gSIawgP8lHkhAL66TlNsVwtKKwVG2V 2TD9R+xgsOdY6W+B77PbDLBKkbe+Gvgpa20IjpiRRw3RMSXGyagBybSHraxtkXjILEGQ kLgc/Unfc3IHVi+4EqrJL0SGk1nTgkLjV73SZ2ZJ6fLdvCLL9etoyr3jbbT1PF26R+Us +71g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=ZofOgfANSjADx0pFop+J4urLhSSdfTPSd4G1GxjXKU8=; b=lcZXgcD/AB/hUmo9+ZFzk76iTz0PeNS1nX37WVuVvUSE0/5LDYdNLz9VLwu6+ICiHe MwhmALoDOE/3KcGPd3XkrjKZ+pS+u7udil/EmNbQkf8OBxEUPLBFWpEz9FSMmtNTxkZS 5RXxHdBP0K2HgE+AshIb1vjCQASUnUn04aOta9SFNEYkaIUGTfsUYh1tYaj1RJCXGL95 WfbL4fyOfGzOqyrEQFWXIUxIgMs0u6/quVcUIQLJ2PSkQpkynUcmH4ls4iyJtkmi9QLd pwFsrTFW2Ph8KChmqi12pYAyW+Zdy+ztVtLtBOIIDnQthyNkr5tjyxF4o4DXw+JoRdQ4 N8rA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12-20020a63db0c000000b00415e89e4c20si6159331pgg.813.2022.07.22.12.27.28; Fri, 22 Jul 2022 12:27:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235829AbiGVTXl (ORCPT + 99 others); Fri, 22 Jul 2022 15:23:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230486AbiGVTXj (ORCPT ); Fri, 22 Jul 2022 15:23:39 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A35EE5F13D; Fri, 22 Jul 2022 12:23:38 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 94A7192009C; Fri, 22 Jul 2022 21:23:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 8971D92009B; Fri, 22 Jul 2022 20:23:36 +0100 (BST) Date: Fri, 22 Jul 2022 20:23:36 +0100 (BST) From: "Maciej W. Rozycki" To: Rob Herring cc: Palmer Dabbelt , Bjorn Helgaas , Stafford Horne , "linux-kernel@vger.kernel.org" , Arnd Bergmann , Catalin Marinas , Will Deacon , Guo Ren , Paul Walmsley , Albert Ou , Richard Weinberger , Anton Ivanov , Johannes Berg , linux-arm-kernel , linux-csky@vger.kernel.org, linux-riscv , linux-um@lists.infradead.org, PCI , "open list:GENERIC INCLUDE/ASM HEADER FILES" Subject: Re: [PATCH v3 2/2] asm-generic: Add new pci.h and use it In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jul 2022, Rob Herring wrote: > > Maybe the right thing to do here is actually to make the default > > definitions of these macros non-zero, or to add some sort of ARCH_ > > flavor of them and move that non-zero requirement closer to where it > > comes from? From the look of it any port that uses the generic port I/O > > functions and has 0 for these will be broken in the same way. > > > > That said, I'm not really a PCI guy so maybe Bjorn or Maciej has a > > better idea? > > >From fu740: > ranges = <0x81000000 0x0 0x60080000 0x0 > 0x60080000 0x0 0x10000>, /* I/O */ > <0x82000000 0x0 0x60090000 0x0 > 0x60090000 0x0 0xff70000>, /* mem */ > <0x82000000 0x0 0x70000000 0x0 > 0x70000000 0x0 0x1000000>, /* mem */ > <0xc3000000 0x20 0x00000000 0x20 > 0x00000000 0x20 0x00000000>; /* mem prefetchable */ > > So again, how does one get a 0 address handed out when that's not even > a valid region according to DT? Is there some legacy stuff that > ignores the bridge windows? It doesn't matter as just sets it as a generic parameter for the platform, reflecting the limitation of PCI core, which in the course of the discussion referred was found rather infeasible to remove. The FU740 does not decode to PCI at 0, but another RISC-V device could. And I think that DT should faithfully describe hardware and not our software limitations. Mind that PCI has originated from the x86 world where decoding low 24-bit memory space to ISA has been implied (implicitly decoded on PCI systems by the southbridge) for areas not decoded to DRAM by the memory controller. So the inability of our PCI core to handle MMIO at 0 did not matter at the time it was introduced as the value of 0 would never be used for a memory BAR. Maciej