From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9092C433E7 for ; Mon, 13 Jul 2020 11:25:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86ACB206F0 for ; Mon, 13 Jul 2020 11:25:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oHgafB9x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86ACB206F0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Xv4QRyg1HtryzW5GtcygXmd84UfwHcDLGqwwHQK/Y0k=; b=oHgafB9xJ2e+mEa1GO+B9A9VD u80XaOsUtZb/CpoICpbup1WUMZRkJ+DKcVV2A/5f9gthQXQpCJt1DlK2jZL9pgFE3GWoAunJzyS3F AOVyxoJH/uV8ukrvVZnhyVP47lgWtiQILjGphPKKERvQ25ZtixRzy+N7imxQjeSpG77j7rDzQRqRg 0llzNWrw1Kk8PwvzSq+clFrmkJ1YmmkaXRkdZjBkaSQqg7kb0M1Ii4+6evBmZt4D53rOY7fQrfjYU xisNJX5SQZz+q178SUAN8p5SvsvEQQ9NLgSR9FEHcs28t9LWoWe2iiWwzv9PzIVZ8KiRU3RVmj8kW EiIi6YMHg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1juwYh-0000uM-GO; Mon, 13 Jul 2020 11:23:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1juwYe-0000tr-LD for linux-arm-kernel@lists.infradead.org; Mon, 13 Jul 2020 11:23:41 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2EC2831B; Mon, 13 Jul 2020 04:23:33 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9709E3F7D8; Mon, 13 Jul 2020 04:23:31 -0700 (PDT) Date: Mon, 13 Jul 2020 12:23:25 +0100 From: Lorenzo Pieralisi To: Pali =?iso-8859-1?Q?Roh=E1r?= Subject: Re: [PATCH v3] PCI: aardvark: Don't touch PCIe registers if no card connected Message-ID: <20200713112325.GA25865@e121166-lin.cambridge.arm.com> References: <20200528143141.29956-1-pali@kernel.org> <20200702083036.12230-1-pali@kernel.org> <20200709113509.GB19638@e121166-lin.cambridge.arm.com> <20200709122208.rmfeuu6zgbwh3fr5@pali> <20200709144701.GA21760@e121166-lin.cambridge.arm.com> <20200709150959.wq6zfkcy4m6hvvpl@pali> <20200710091800.GA3419@e121166-lin.cambridge.arm.com> <20200713082747.e3q3ml3wpbszn4j7@pali> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200713082747.e3q3ml3wpbszn4j7@pali> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200713_072341_060651_366F0EB5 X-CRM114-Status: GOOD ( 20.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomasz Maciej Nowak , linux-pci@vger.kernel.org, Xogium , linux-kernel@vger.kernel.org, Marek =?iso-8859-1?Q?Beh=FAn?= , Remi Pommarel , Thomas Petazzoni , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, Andrew Murray Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 13, 2020 at 10:27:47AM +0200, Pali Roh=E1r wrote: > On Friday 10 July 2020 10:18:00 Lorenzo Pieralisi wrote: > > On Thu, Jul 09, 2020 at 05:09:59PM +0200, Pali Roh=E1r wrote: > > > > I understand that but the bridge bus resource can be trimmed to just > > > > contain the root bus because that's the only one where there is a > > > > chance you can enumerate a device. > > > = > > > It is possible to register only root bridge without endpoint? > > = > > It is possible to register the root bridge with a trimmed IORESOURCE_BUS > > so that you don't enumerate anything other than the root port. > = > Hello Lorenzo! I really do not know how to achieve it. From code it > looks like that pci/probe.c scans child buses unconditionally. > = > pci-aardvark.c calls pci_host_probe() which calls functions > pci_scan_root_bus_bridge() which calls pci_scan_child_bus() which calls > pci_scan_child_bus_extend() which calls pci_scan_bridge_extend() (bridge > needs to be reconfigured) which then try to probe child bus via > pci_scan_child_bus_extend() because bridge is not card bus. > = > In function pci_scan_bridge_extend() I do not see a way how to skip > probing for child buses which would avoid enumerating aardvark root > bridge when PCIe device is not connected. > = > dmesg output contains: > = > advk-pcie d0070000.pcie: link never came up > advk-pcie d0070000.pcie: PCI host bridge to bus 0000:00 > pci_bus 0000:00: root bus resource [bus 00-ff] This resource can be limited to the root bus number only before calling pci_host_probe() (ie see pci_parse_request_of_pci_ranges() and code in pci_scan_bridge_extend() that programs primary/secondary/subordinate busses) but I think that only papers over the issue, it does not fix it. I will go over the thread again but I suspect I can merge the patch even though I still believe there is work to be done to understand the issue we are facing. Lorenzo > pci_bus 0000:00: root bus resource [mem 0xe8000000-0xe8ffffff] > pci_bus 0000:00: root bus resource [io 0x0000-0xffff] (bus address [0x= e9000000-0xe900ffff]) > pci_bus 0000:00: scanning bus > pci 0000:00:00.0: [1b4b:0100] type 01 class 0x060400 > pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x000007ff pref] > pci_bus 0000:00: fixups for bus > pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 0 > pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfigu= ring > pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1 > pci_bus 0000:01: scanning bus > advk-pcie d0070000.pcie: advk_pcie_valid_device _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel