summaryrefslogtreecommitdiffstats
path: root/drivers/xen/pci.c
diff options
context:
space:
mode:
authorRoss Lagerwall <ross.lagerwall@citrix.com>2015-04-09 09:05:10 +0200
committerDavid Vrabel <david.vrabel@citrix.com>2015-04-15 11:57:28 +0200
commit0b97b03d88b40bfbd7ff0e069186a137d9786d43 (patch)
tree37feef841dd5c71bbc22c92137bc94241b74b91f /drivers/xen/pci.c
parentxenbus_client: Extend interface to support multi-page ring (diff)
downloadlinux-0b97b03d88b40bfbd7ff0e069186a137d9786d43.tar.xz
linux-0b97b03d88b40bfbd7ff0e069186a137d9786d43.zip
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>
Diffstat (limited to 'drivers/xen/pci.c')
-rw-r--r--drivers/xen/pci.c15
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 @@
#include <linux/pci.h>
#include <linux/acpi.h>
+#include <linux/pci-acpi.h>
#include <xen/xen.h>
#include <xen/interface/physdev.h>
#include <xen/interface/xen.h>
@@ -67,12 +68,22 @@ static int xen_add_device(struct device *dev)
#ifdef CONFIG_ACPI
handle = ACPI_HANDLE(&pci_dev->dev);
- if (!handle && pci_dev->bus->bridge)
- handle = ACPI_HANDLE(pci_dev->bus->bridge);
#ifdef CONFIG_PCI_IOV
if (!handle && pci_dev->is_virtfn)
handle = ACPI_HANDLE(physfn->bus->bridge);
#endif
+ if (!handle) {
+ /*
+ * This device was not listed in the ACPI name space at
+ * all. Try to get acpi handle of parent pci bus.
+ */
+ struct pci_bus *pbus;
+ for (pbus = pci_dev->bus; pbus; pbus = pbus->parent) {
+ handle = acpi_pci_get_bridge_handle(pbus);
+ if (handle)
+ break;
+ }
+ }
if (handle) {
acpi_status status;