Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'pci/enumeration' into next

* pci/enumeration:
PCI: Remove duplicate check for positive return value from probe() functions
PCI: Enable PCIe Extended Tags if supported
PCI: Avoid possible deadlock on pci_lock and p->pi_lock
PCI/ACPI: Fix bus range comparison in pci_mcfg_lookup()
PCI: Apply _HPX settings only to relevant devices

+35 -8
+2 -3
drivers/acpi/pci_mcfg.c
··· 195 195 goto skip_lookup; 196 196 197 197 /* 198 - * We expect exact match, unless MCFG entry end bus covers more than 199 - * specified by caller. 198 + * We expect the range in bus_res in the coverage of MCFG bus range. 200 199 */ 201 200 list_for_each_entry(e, &pci_mcfg_list, list) { 202 - if (e->segment == seg && e->bus_start == bus_res->start && 201 + if (e->segment == seg && e->bus_start <= bus_res->start && 203 202 e->bus_end >= bus_res->end) { 204 203 root->mcfg_addr = e->addr; 205 204 }
+2 -1
drivers/pci/access.c
··· 684 684 WARN_ON(!dev->block_cfg_access); 685 685 686 686 dev->block_cfg_access = 0; 687 - wake_up_all(&pci_cfg_wait); 688 687 raw_spin_unlock_irqrestore(&pci_lock, flags); 688 + 689 + wake_up_all(&pci_cfg_wait); 689 690 } 690 691 EXPORT_SYMBOL_GPL(pci_cfg_access_unlock); 691 692
-2
drivers/pci/pci-driver.c
··· 381 381 id = pci_match_device(drv, pci_dev); 382 382 if (id) 383 383 error = pci_call_probe(drv, pci_dev, id); 384 - if (error >= 0) 385 - error = 0; 386 384 } 387 385 return error; 388 386 }
+31 -2
drivers/pci/probe.c
··· 1554 1554 1555 1555 static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp) 1556 1556 { 1557 - if (hpp) 1558 - dev_warn(&dev->dev, "PCI-X settings not supported\n"); 1557 + int pos; 1558 + 1559 + if (!hpp) 1560 + return; 1561 + 1562 + pos = pci_find_capability(dev, PCI_CAP_ID_PCIX); 1563 + if (!pos) 1564 + return; 1565 + 1566 + dev_warn(&dev->dev, "PCI-X settings not supported\n"); 1559 1567 } 1560 1568 1561 1569 static bool pcie_root_rcb_set(struct pci_dev *dev) ··· 1587 1579 u32 reg32; 1588 1580 1589 1581 if (!hpp) 1582 + return; 1583 + 1584 + if (!pci_is_pcie(dev)) 1590 1585 return; 1591 1586 1592 1587 if (hpp->revision > 1) { ··· 1661 1650 */ 1662 1651 } 1663 1652 1653 + static void pci_configure_extended_tags(struct pci_dev *dev) 1654 + { 1655 + u32 dev_cap; 1656 + int ret; 1657 + 1658 + if (!pci_is_pcie(dev)) 1659 + return; 1660 + 1661 + ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &dev_cap); 1662 + if (ret) 1663 + return; 1664 + 1665 + if (dev_cap & PCI_EXP_DEVCAP_EXT_TAG) 1666 + pcie_capability_set_word(dev, PCI_EXP_DEVCTL, 1667 + PCI_EXP_DEVCTL_EXT_TAG); 1668 + } 1669 + 1664 1670 static void pci_configure_device(struct pci_dev *dev) 1665 1671 { 1666 1672 struct hotplug_params hpp; 1667 1673 int ret; 1668 1674 1669 1675 pci_configure_mps(dev); 1676 + pci_configure_extended_tags(dev); 1670 1677 1671 1678 memset(&hpp, 0, sizeof(hpp)); 1672 1679 ret = pci_get_hp_params(dev, &hpp);