diff options
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 0b2be174d981..8361d27e5eca 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -676,15 +676,20 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus) | |||
676 | static void pci_set_bus_msi_domain(struct pci_bus *bus) | 676 | static void pci_set_bus_msi_domain(struct pci_bus *bus) |
677 | { | 677 | { |
678 | struct irq_domain *d; | 678 | struct irq_domain *d; |
679 | struct pci_bus *b; | ||
679 | 680 | ||
680 | /* | 681 | /* |
681 | * Either bus is the root, and we must obtain it from the | 682 | * The bus can be a root bus, a subordinate bus, or a virtual bus |
682 | * firmware, or we inherit it from the bridge device. | 683 | * created by an SR-IOV device. Walk up to the first bridge device |
684 | * found or derive the domain from the host bridge. | ||
683 | */ | 685 | */ |
684 | if (pci_is_root_bus(bus)) | 686 | for (b = bus, d = NULL; !d && !pci_is_root_bus(b); b = b->parent) { |
685 | d = pci_host_bridge_msi_domain(bus); | 687 | if (b->self) |
686 | else | 688 | d = dev_get_msi_domain(&b->self->dev); |
687 | d = dev_get_msi_domain(&bus->self->dev); | 689 | } |
690 | |||
691 | if (!d) | ||
692 | d = pci_host_bridge_msi_domain(b); | ||
688 | 693 | ||
689 | dev_set_msi_domain(&bus->dev, d); | 694 | dev_set_msi_domain(&bus->dev, d); |
690 | } | 695 | } |
@@ -855,9 +860,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) | |||
855 | child->bridge_ctl = bctl; | 860 | child->bridge_ctl = bctl; |
856 | } | 861 | } |
857 | 862 | ||
858 | /* Read and initialize bridge resources */ | ||
859 | pci_read_bridge_bases(child); | ||
860 | |||
861 | cmax = pci_scan_child_bus(child); | 863 | cmax = pci_scan_child_bus(child); |
862 | if (cmax > subordinate) | 864 | if (cmax > subordinate) |
863 | dev_warn(&dev->dev, "bridge has subordinate %02x but max busn %02x\n", | 865 | dev_warn(&dev->dev, "bridge has subordinate %02x but max busn %02x\n", |
@@ -918,9 +920,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) | |||
918 | 920 | ||
919 | if (!is_cardbus) { | 921 | if (!is_cardbus) { |
920 | child->bridge_ctl = bctl; | 922 | child->bridge_ctl = bctl; |
921 | |||
922 | /* Read and initialize bridge resources */ | ||
923 | pci_read_bridge_bases(child); | ||
924 | max = pci_scan_child_bus(child); | 923 | max = pci_scan_child_bus(child); |
925 | } else { | 924 | } else { |
926 | /* | 925 | /* |