linux/debian/patches/features/all/xen/fix-pci-hook.patch

52 lines
1.3 KiB
Diff

diff --git a/drivers/xen/core/pci.c b/drivers/xen/core/pci.c
index 2710c18..3fd5167 100644
--- a/drivers/xen/core/pci.c
+++ b/drivers/xen/core/pci.c
@@ -12,7 +12,7 @@ static int (*pci_bus_remove)(struct device *dev);
static int pci_bus_probe_wrapper(struct device *dev)
{
- int r;
+ int r, r1;
struct pci_dev *pci_dev = to_pci_dev(dev);
struct physdev_manage_pci manage_pci;
manage_pci.bus = pci_dev->bus->number;
@@ -23,16 +23,19 @@ static int pci_bus_probe_wrapper(struct device *dev)
return r;
r = pci_bus_probe(dev);
- if (r)
- WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_remove,
- &manage_pci));
+ if (r) {
+ r1 = HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_remove,
+ &manage_pci);
+ if (r1 && r1 != -ENOSYS)
+ WARN_ON(1);
+ }
return r;
}
static int pci_bus_remove_wrapper(struct device *dev)
{
- int r;
+ int r, r1;
struct pci_dev *pci_dev = to_pci_dev(dev);
struct physdev_manage_pci manage_pci;
manage_pci.bus = pci_dev->bus->number;
@@ -41,8 +44,11 @@ static int pci_bus_remove_wrapper(struct device *dev)
r = pci_bus_remove(dev);
/* dev and pci_dev are no longer valid!! */
- WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_remove,
- &manage_pci));
+ r1 = HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_remove,
+ &manage_pci);
+ if (r1 && r1 != -ENOSYS)
+ WARN_ON(1);
+
return r;
}