diff options
Diffstat (limited to 'arch/sparc64/kernel/pci.c')
-rw-r--r-- | arch/sparc64/kernel/pci.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 3d93e9203ba2..e8dac81d8a0d 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -393,7 +393,6 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
393 | sd->host_controller = pbm; | 393 | sd->host_controller = pbm; |
394 | sd->prom_node = node; | 394 | sd->prom_node = node; |
395 | sd->op = of_find_device_by_node(node); | 395 | sd->op = of_find_device_by_node(node); |
396 | sd->msi_num = 0xffffffff; | ||
397 | 396 | ||
398 | sd = &sd->op->dev.archdata; | 397 | sd = &sd->op->dev.archdata; |
399 | sd->iommu = pbm->iommu; | 398 | sd->iommu = pbm->iommu; |
@@ -745,7 +744,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, | |||
745 | { | 744 | { |
746 | struct device_node *child; | 745 | struct device_node *child; |
747 | const u32 *reg; | 746 | const u32 *reg; |
748 | int reglen, devfn; | 747 | int reglen, devfn, prev_devfn; |
749 | struct pci_dev *dev; | 748 | struct pci_dev *dev; |
750 | 749 | ||
751 | if (ofpci_verbose) | 750 | if (ofpci_verbose) |
@@ -753,14 +752,25 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, | |||
753 | node->full_name, bus->number); | 752 | node->full_name, bus->number); |
754 | 753 | ||
755 | child = NULL; | 754 | child = NULL; |
755 | prev_devfn = -1; | ||
756 | while ((child = of_get_next_child(node, child)) != NULL) { | 756 | while ((child = of_get_next_child(node, child)) != NULL) { |
757 | if (ofpci_verbose) | 757 | if (ofpci_verbose) |
758 | printk(" * %s\n", child->full_name); | 758 | printk(" * %s\n", child->full_name); |
759 | reg = of_get_property(child, "reg", ®len); | 759 | reg = of_get_property(child, "reg", ®len); |
760 | if (reg == NULL || reglen < 20) | 760 | if (reg == NULL || reglen < 20) |
761 | continue; | 761 | continue; |
762 | |||
762 | devfn = (reg[0] >> 8) & 0xff; | 763 | devfn = (reg[0] >> 8) & 0xff; |
763 | 764 | ||
765 | /* This is a workaround for some device trees | ||
766 | * which list PCI devices twice. On the V100 | ||
767 | * for example, device number 3 is listed twice. | ||
768 | * Once as "pm" and once again as "lomp". | ||
769 | */ | ||
770 | if (devfn == prev_devfn) | ||
771 | continue; | ||
772 | prev_devfn = devfn; | ||
773 | |||
764 | /* create a new pci_dev for this device */ | 774 | /* create a new pci_dev for this device */ |
765 | dev = of_create_pci_dev(pbm, child, bus, devfn, 0); | 775 | dev = of_create_pci_dev(pbm, child, bus, devfn, 0); |
766 | if (!dev) | 776 | if (!dev) |