From mboxrd@z Thu Jan 1 00:00:00 1970 From: benh@kernel.crashing.org (Benjamin Herrenschmidt) Date: Tue, 30 Sep 2014 07:02:01 +1000 Subject: [PATCH v13 10/12] PCI: Assign unassigned bus resources in pci_scan_root_bus() In-Reply-To: References: <1412000971-9242-1-git-send-email-Liviu.Dudau@arm.com> <1412000971-9242-11-git-send-email-Liviu.Dudau@arm.com> Message-ID: <1412024521.4285.98.camel@pasglop> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, 2014-09-29 at 12:06 -0700, Yinghai Lu wrote: > On Mon, Sep 29, 2014 at 11:25 AM, Yinghai Lu wrote: > > On Mon, Sep 29, 2014 at 7:29 AM, Liviu Dudau wrote: > >> If the firmware has not assigned all the bus resources and we are not just > >> probing the PCI buses, it makes sense to assign the unassigned resources > >> in pci_scan_root_bus(). > >> > >> Signed-off-by: Liviu Dudau > >> Signed-off-by: Bjorn Helgaas > >> CC: Arnd Bergmann > >> CC: Jason Gunthorpe > >> CC: Rob Herring > >> --- > >> drivers/pci/probe.c | 3 +++ > >> 1 file changed, 3 insertions(+) > >> > >> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > >> index 636d1c9..d2ebd49 100644 > >> --- a/drivers/pci/probe.c > >> +++ b/drivers/pci/probe.c > >> @@ -1951,6 +1951,9 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, > >> if (!found) > >> pci_bus_update_busn_res_end(b, max); > >> > >> + if (!pci_has_flag(PCI_PROBE_ONLY)) > >> + pci_assign_unassigned_bus_resources(b); > >> + > >> pci_bus_add_devices(b); > >> return b; > >> } > > > > No, you can not do it that early. > > > > On x86, we need to call > > pcibios_resource_survey_bus at first. > > on x86: > pcibios_init > pcibios_resource_survey() > pcibios_assign_resources() via fs_initcall Right and on powerpc and others as well. We need to survey existing resources. We also have a number of platform things that might need to happen before we do the final re-assignment pass. Ben.