Re: [PATCH 4/4] x86/PCI: use pci_create_host_bridge() so PCI core knows subordinate buses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 17, 2012 at 4:35 PM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote:
> If the PCI core knows the entire subordinate bus range (not just the
> root bus number), it can restrict enumeration to just those buses.
> If we enumerate devices under the wrong host bridge, we'll use the
> wrong resources for those devices.
>
> Reference: https://bugzilla.novell.com/show_bug.cgi?id=735909
> Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> ---
>  arch/x86/pci/acpi.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
> index a312e76..0a45d1c 100644
> --- a/arch/x86/pci/acpi.c
> +++ b/arch/x86/pci/acpi.c
> @@ -349,6 +349,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
>        int domain = root->segment;
>        int busnum = root->secondary.start;
>        LIST_HEAD(resources);
> +       struct pci_host_bridge *bridge;
>        struct pci_bus *bus;
>        struct pci_sysdata *sd;
>        int node;
> @@ -406,8 +407,9 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
>                get_current_resources(device, busnum, domain, &resources);
>                if (list_empty(&resources))
>                        x86_pci_root_bus_resources(busnum, &resources);
> -               bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd,
> -                                         &resources);
> +               bridge = pci_create_host_bridge(NULL, domain, &root->secondary,
> +                                               &resources, &pci_root_ops, sd);
> +               bus = bridge ? bridge->bus : NULL;
>                if (bus)
>                        bus->subordinate = pci_scan_child_bus(bus);
>                else

Maybe you can separate create host_bridge and root_bus.

like for regular bridge device/bus: We first have new device and then
if the device is bridge, will scan that
bridge to get (create) bus.

Thanks

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


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux