Commit 63ab93f0 authored by Bjorn Helgaas's avatar Bjorn Helgaas

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
parents af3a2ab5 fed67814
...@@ -195,11 +195,10 @@ int pci_mcfg_lookup(struct acpi_pci_root *root, struct resource *cfgres, ...@@ -195,11 +195,10 @@ int pci_mcfg_lookup(struct acpi_pci_root *root, struct resource *cfgres,
goto skip_lookup; goto skip_lookup;
/* /*
* We expect exact match, unless MCFG entry end bus covers more than * We expect the range in bus_res in the coverage of MCFG bus range.
* specified by caller.
*/ */
list_for_each_entry(e, &pci_mcfg_list, list) { list_for_each_entry(e, &pci_mcfg_list, list) {
if (e->segment == seg && e->bus_start == bus_res->start && if (e->segment == seg && e->bus_start <= bus_res->start &&
e->bus_end >= bus_res->end) { e->bus_end >= bus_res->end) {
root->mcfg_addr = e->addr; root->mcfg_addr = e->addr;
} }
......
...@@ -684,8 +684,9 @@ void pci_cfg_access_unlock(struct pci_dev *dev) ...@@ -684,8 +684,9 @@ void pci_cfg_access_unlock(struct pci_dev *dev)
WARN_ON(!dev->block_cfg_access); WARN_ON(!dev->block_cfg_access);
dev->block_cfg_access = 0; dev->block_cfg_access = 0;
wake_up_all(&pci_cfg_wait);
raw_spin_unlock_irqrestore(&pci_lock, flags); raw_spin_unlock_irqrestore(&pci_lock, flags);
wake_up_all(&pci_cfg_wait);
} }
EXPORT_SYMBOL_GPL(pci_cfg_access_unlock); EXPORT_SYMBOL_GPL(pci_cfg_access_unlock);
......
...@@ -381,8 +381,6 @@ static int __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev) ...@@ -381,8 +381,6 @@ static int __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev)
id = pci_match_device(drv, pci_dev); id = pci_match_device(drv, pci_dev);
if (id) if (id)
error = pci_call_probe(drv, pci_dev, id); error = pci_call_probe(drv, pci_dev, id);
if (error >= 0)
error = 0;
} }
return error; return error;
} }
......
...@@ -1554,7 +1554,15 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp) ...@@ -1554,7 +1554,15 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp)
static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp) static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp)
{ {
if (hpp) int pos;
if (!hpp)
return;
pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
if (!pos)
return;
dev_warn(&dev->dev, "PCI-X settings not supported\n"); dev_warn(&dev->dev, "PCI-X settings not supported\n");
} }
...@@ -1581,6 +1589,9 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp) ...@@ -1581,6 +1589,9 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
if (!hpp) if (!hpp)
return; return;
if (!pci_is_pcie(dev))
return;
if (hpp->revision > 1) { if (hpp->revision > 1) {
dev_warn(&dev->dev, "PCIe settings rev %d not supported\n", dev_warn(&dev->dev, "PCIe settings rev %d not supported\n",
hpp->revision); hpp->revision);
...@@ -1650,12 +1661,30 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp) ...@@ -1650,12 +1661,30 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
*/ */
} }
static void pci_configure_extended_tags(struct pci_dev *dev)
{
u32 dev_cap;
int ret;
if (!pci_is_pcie(dev))
return;
ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &dev_cap);
if (ret)
return;
if (dev_cap & PCI_EXP_DEVCAP_EXT_TAG)
pcie_capability_set_word(dev, PCI_EXP_DEVCTL,
PCI_EXP_DEVCTL_EXT_TAG);
}
static void pci_configure_device(struct pci_dev *dev) static void pci_configure_device(struct pci_dev *dev)
{ {
struct hotplug_params hpp; struct hotplug_params hpp;
int ret; int ret;
pci_configure_mps(dev); pci_configure_mps(dev);
pci_configure_extended_tags(dev);
memset(&hpp, 0, sizeof(hpp)); memset(&hpp, 0, sizeof(hpp));
ret = pci_get_hp_params(dev, &hpp); ret = pci_get_hp_params(dev, &hpp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment