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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98327C00140 for ; Wed, 3 Aug 2022 02:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CtUI+8Xaf6SYjqg32DlACanVBUBfZ2DlCiqTSi9lCu4=; b=BUQWyTQsGedzXx 7gULQ4y0LpseXZMY2wNvw0xwlGY/gbXccQ/sKdnLDwLlCovnZ9nYpCXdnkJVQTzJOlo/agQc3etju KK80SoDMUDDkWUUmkmYzqWABW1e60pYcE4x79Lsi11adowTIapmogdHgoBAna+rCtlGs5NDXIgsH0 8nBDhLTNxg0shHMft/w+CP0t8BKn0v3A/FCfAmxRKzJh6zPAffT/X7RhzUpqk0HhBI2PUNIuVghs+ HLg3cFWUiHt5n+M/9+s3IHZcTFa2BZgmYMrDyJSsZJN0SyYmx/KsnofHMmxi7MiGR+y2SoflKvNOm xcGNTZtRVSXndXHlQzVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJ4GT-001gw2-70; Wed, 03 Aug 2022 02:37:41 +0000 Received: from gate.crashing.org ([63.228.1.57]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJ4GN-001gld-Fa for linux-arm-kernel@lists.infradead.org; Wed, 03 Aug 2022 02:37:37 +0000 Received: from ip6-localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 2732WBcd017473; Tue, 2 Aug 2022 21:32:12 -0500 Message-ID: <4a1ea48b5a3807e00df1342932daa76fa313afef.camel@kernel.crashing.org> Subject: Re: [EXTERNAL]arm64 PCI resource allocation issue From: Benjamin Herrenschmidt To: David Woodhouse , Ard Biesheuvel Cc: linux-pci@vger.kernel.org, bhelgaas@google.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, Jeremy Linton , Ali Saidi , Robin Murphy Date: Wed, 03 Aug 2022 12:32:11 +1000 In-Reply-To: References: <204dda77248a7c95787e27fc7a382f514341c88e.camel@kernel.crashing.org> User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220802_193735_664566_48C76EF2 X-CRM114-Status: GOOD ( 24.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 2022-08-02 at 10:18 +0100, David Woodhouse wrote: > On Tue, 2022-08-02 at 09:46 +0200, Ard Biesheuvel wrote: > > > If we want this, I would propose (happy to provide the implementation > > > but let's discuss the design first) something along the line of a > > > generic mechanism to "register" such a system device, which would add > > > it to a list. That list would be scanned on PCI device discovery for > > > BAR address matches, and the pci_dev/BAR# added to the entry (that or > > > put a pointer to the entry into pci_dev for speed/efficiency). > > > > This means that bus numbers cannot be reassigned, which I don't think > > we rely on today. To positively identify a PCI device, you'll need > > some kind of path notation to avoid relying on the bus numbers > > assigned by the firmware (this could happen for hot-pluggable root > > ports where no bus range has been reserved by the firmware) > > That kind of path notation already exists for the Intel IOMMU, and > probably others. See dmar_match_pci_path(), dmar_pci_bus_add_dev() etc. > > It would be good to lift that out and make it generic, rather than > reinventing another version. I think this is a completely orthogonal issue to what I'm trying to solve. I don't think we actually have a problem with bus numbers changing (see my other response). Yes, bus-number-agnostic PCI paths have been a thing for a long time in device-tree land :) Cheers, Ben. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel