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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable 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 02D80C48BE0 for ; Fri, 21 Jun 2019 20:06:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CB1232089E for ; Fri, 21 Jun 2019 20:06:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kGzKOt5R"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="niInD/1A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB1232089E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.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=GXMM/axSLShDf2ICYkOnHAQdTTAp8zFjKAkDXVoNDP4=; b=kGzKOt5RTviXAA Z96LmIaf00sl/0GlYu7vBAbgAHm8bJ9ylJaDNEXY+rgBHY9JexwF4HduJHwMalbVEWXV6SObfPh+j GLBmtv1LUrb3Mfs+wdSrDlGDTMfXVB4f3Dl8JmOaoANwvS+xZo86iQwHLqThwIgZoAWwlolQJfgIF Zwq3DOnSsyS0KWeKYUYDOEy99uyBsPCeH3yFEoGgAgnuabkIkqTjPsZ8zwDlNDMBoIq00rdN2vgqL w6zS9ouNVbJu+6toT9fsvrxgpMG+x2TjPdAwzIte7PfagZ7e74YJz0U/YoRv6eKALEUGeXGjByep6 Xe2GQbAmkiK85A0JzDjA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hePo7-0007Y3-Eq; Fri, 21 Jun 2019 20:06:47 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hePo4-0007Xb-2P for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2019 20:06:45 +0000 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2F36620673; Fri, 21 Jun 2019 20:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561147603; bh=4Q+RFCpdW2sWFHYDR6CaEb8dLMWyiQ24AKk3JVhgTc4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=niInD/1ACc2tCSDVeaqiAMarUOMqAUFTDnSdC2VuCBdoSt83DJwWtg+RwP1CoAbXB MYdKJKyDuvdUesMUQHgKBLBYEPrcdwVh7mq5CHbRPGdNW7WIrRevMyidGrqqg2Gp4o aX7baCouS+jszHQECG1ZwtOuubQkBo59I4wI+7Ug= Date: Fri, 21 Jun 2019 15:06:41 -0500 From: Bjorn Helgaas To: Benjamin Herrenschmidt Subject: Re: [PATCH 1/4] arm64: pci: acpi: Use pci_assign_unassigned_root_bus_resources() Message-ID: <20190621200641.GB127746@google.com> References: <20190615002359.29577-1-benh@kernel.crashing.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190615002359.29577-1-benh@kernel.crashing.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190621_130644_131346_79EF9097 X-CRM114-Status: GOOD ( 15.40 ) 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: Lorenzo Pieralisi , Ard Biesheuvel , linux-pci@vger.kernel.org, Sinan Kaya , Zeev Zilberman , linux-arm-kernel , Ali Saidi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Match the subject line convention, e.g., arm64: PCI: Use pci_assign_unassigned_root_bus_resources() But the function name doesn't really tell us anything unless we already know how everything works. I think the point is that pci_assign_unassigned_root_bus_resources() gives us the possibility of reallocating things if necessary. A subject that hints at that would be good. On Sat, Jun 15, 2019 at 10:23:56AM +1000, Benjamin Herrenschmidt wrote: > Instead of the simpler > > pci_bus_size_bridges(bus); > pci_bus_assign_resources(bus); > > Use pci_assign_unassigned_root_bus_resources(). This should have no > effect as long as we are reassigning everything. pci_bus_size_bridges(bus) == __pci_bus_size_bridges(bus, NULL) pci_bus_assign_resources(bus) == __pci_bus_assign_resources(bus, NULL, NULL) and we have: pci_assign_unassigned_root_bus_resources() { ... __pci_bus_size_bridges(bus, add_list); __pci_bus_assign_resources(bus, add_list, &fail_head); so I guess this should have no effect as long as we were able to assign everything. If we were unable to assign something, previously we did nothing and left it unassigned, but after this patch, we will attempt to do some reallocation. Right? > Once we start honoring FW resource allocations, this will bring up > the "reallocation" feature which can help making room for SR-IOV > when necessary. I think this should be reordered so it's immediately before the patch that checks hb->preserve_config, i.e., the patch that honors FW assignments. > Signed-off-by: Benjamin Herrenschmidt > --- > arch/arm64/kernel/pci.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c > index bb85e2f4603f..1419b1b4e9b9 100644 > --- a/arch/arm64/kernel/pci.c > +++ b/arch/arm64/kernel/pci.c > @@ -193,8 +193,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) > if (!bus) > return NULL; > > - pci_bus_size_bridges(bus); > - pci_bus_assign_resources(bus); > + pci_assign_unassigned_root_bus_resources(bus); > > list_for_each_entry(child, &bus->children, node) > pcie_bus_configure_settings(child); > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel