diff options
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 290c657da0b9..c99c4d65461b 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -741,6 +741,17 @@ struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, | |||
741 | } | 741 | } |
742 | EXPORT_SYMBOL(pci_add_new_bus); | 742 | EXPORT_SYMBOL(pci_add_new_bus); |
743 | 743 | ||
744 | static void pci_enable_crs(struct pci_dev *pdev) | ||
745 | { | ||
746 | u16 root_cap = 0; | ||
747 | |||
748 | /* Enable CRS Software Visibility if supported */ | ||
749 | pcie_capability_read_word(pdev, PCI_EXP_RTCAP, &root_cap); | ||
750 | if (root_cap & PCI_EXP_RTCAP_CRSVIS) | ||
751 | pcie_capability_set_word(pdev, PCI_EXP_RTCTL, | ||
752 | PCI_EXP_RTCTL_CRSSVE); | ||
753 | } | ||
754 | |||
744 | /* | 755 | /* |
745 | * If it's a bridge, configure it and scan the bus behind it. | 756 | * If it's a bridge, configure it and scan the bus behind it. |
746 | * For CardBus bridges, we don't scan behind as the devices will | 757 | * For CardBus bridges, we don't scan behind as the devices will |
@@ -788,6 +799,8 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) | |||
788 | pci_write_config_word(dev, PCI_BRIDGE_CONTROL, | 799 | pci_write_config_word(dev, PCI_BRIDGE_CONTROL, |
789 | bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT); | 800 | bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT); |
790 | 801 | ||
802 | pci_enable_crs(dev); | ||
803 | |||
791 | if ((secondary || subordinate) && !pcibios_assign_all_busses() && | 804 | if ((secondary || subordinate) && !pcibios_assign_all_busses() && |
792 | !is_cardbus && !broken) { | 805 | !is_cardbus && !broken) { |
793 | unsigned int cmax; | 806 | unsigned int cmax; |
@@ -1424,8 +1437,13 @@ bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l, | |||
1424 | *l == 0x0000ffff || *l == 0xffff0000) | 1437 | *l == 0x0000ffff || *l == 0xffff0000) |
1425 | return false; | 1438 | return false; |
1426 | 1439 | ||
1427 | /* Configuration request Retry Status */ | 1440 | /* |
1428 | while (*l == 0xffff0001) { | 1441 | * Configuration Request Retry Status. Some root ports return the |
1442 | * actual device ID instead of the synthetic ID (0xFFFF) required | ||
1443 | * by the PCIe spec. Ignore the device ID and only check for | ||
1444 | * (vendor id == 1). | ||
1445 | */ | ||
1446 | while ((*l & 0xffff) == 0x0001) { | ||
1429 | if (!crs_timeout) | 1447 | if (!crs_timeout) |
1430 | return false; | 1448 | return false; |
1431 | 1449 | ||