diff options
| author | Ross Lagerwall <ross.lagerwall@citrix.com> | 2015-04-09 03:05:10 -0400 |
|---|---|---|
| committer | David Vrabel <david.vrabel@citrix.com> | 2015-04-15 05:57:28 -0400 |
| commit | 0b97b03d88b40bfbd7ff0e069186a137d9786d43 (patch) | |
| tree | 37feef841dd5c71bbc22c92137bc94241b74b91f | |
| parent | ccc9d90a9a8b5c4ad7e9708ec41f75ff9e98d61d (diff) | |
xen/pci: Try harder to get PXM information for Xen
If the device being added to Xen is not contained in the ACPI table,
walk the PCI device tree to find a parent that is contained in the ACPI
table before finding the PXM information from this device.
Previously, it would try to get a handle for the device, then the
device's bridge, then the physfn. This changes the order so that it
tries to get a handle for the device, then the physfn, the walks up the
PCI device tree.
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
| -rw-r--r-- | drivers/xen/pci.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index 95ee4302ffb8..7494dbeb4409 100644 --- a/drivers/xen/pci.c +++ b/drivers/xen/pci.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #include <linux/pci.h> | 20 | #include <linux/pci.h> |
| 21 | #include <linux/acpi.h> | 21 | #include <linux/acpi.h> |
| 22 | #include <linux/pci-acpi.h> | ||
| 22 | #include <xen/xen.h> | 23 | #include <xen/xen.h> |
| 23 | #include <xen/interface/physdev.h> | 24 | #include <xen/interface/physdev.h> |
| 24 | #include <xen/interface/xen.h> | 25 | #include <xen/interface/xen.h> |
| @@ -67,12 +68,22 @@ static int xen_add_device(struct device *dev) | |||
| 67 | 68 | ||
| 68 | #ifdef CONFIG_ACPI | 69 | #ifdef CONFIG_ACPI |
| 69 | handle = ACPI_HANDLE(&pci_dev->dev); | 70 | handle = ACPI_HANDLE(&pci_dev->dev); |
| 70 | if (!handle && pci_dev->bus->bridge) | ||
| 71 | handle = ACPI_HANDLE(pci_dev->bus->bridge); | ||
| 72 | #ifdef CONFIG_PCI_IOV | 71 | #ifdef CONFIG_PCI_IOV |
| 73 | if (!handle && pci_dev->is_virtfn) | 72 | if (!handle && pci_dev->is_virtfn) |
| 74 | handle = ACPI_HANDLE(physfn->bus->bridge); | 73 | handle = ACPI_HANDLE(physfn->bus->bridge); |
| 75 | #endif | 74 | #endif |
| 75 | if (!handle) { | ||
| 76 | /* | ||
| 77 | * This device was not listed in the ACPI name space at | ||
| 78 | * all. Try to get acpi handle of parent pci bus. | ||
| 79 | */ | ||
| 80 | struct pci_bus *pbus; | ||
| 81 | for (pbus = pci_dev->bus; pbus; pbus = pbus->parent) { | ||
| 82 | handle = acpi_pci_get_bridge_handle(pbus); | ||
| 83 | if (handle) | ||
| 84 | break; | ||
| 85 | } | ||
| 86 | } | ||
| 76 | if (handle) { | 87 | if (handle) { |
| 77 | acpi_status status; | 88 | acpi_status status; |
| 78 | 89 | ||
