Re: [PATCH v13 10/12] PCI: Assign unassigned bus resources in pci_scan_root_bus()

From: Yinghai Lu
Date: Mon Sep 29 2014 - 14:25:26 EST


On Mon, Sep 29, 2014 at 7:29 AM, Liviu Dudau <Liviu.Dudau@xxxxxxx> 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 <Liviu.Dudau@xxxxxxx>
> Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> CC: Arnd Bergmann <arnd@xxxxxxxx>
> CC: Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx>
> CC: Rob Herring <robh+dt@xxxxxxxxxx>
> ---
> 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.

Thanks

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/