diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 1320b48a50ac52cc02a52e1c378c26a648bec851..95d7a5fb8ffc544268eea9d2a3f2f49ec2820be1 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -848,6 +848,7 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge) bus->sysdata = bridge->sysdata; bus->msi = bridge->msi; bus->ops = bridge->ops; + bus->backup_ops = bus->ops; bus->number = bus->busn_res.start = bridge->busnr; #ifdef CONFIG_PCI_DOMAINS_GENERIC bus->domain_nr = pci_bus_find_domain_nr(bus, parent); @@ -993,7 +994,11 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, return NULL; child->parent = parent; - child->ops = parent->ops; + if (parent->backup_ops) + child->ops = parent->backup_ops; + else + child->ops = parent->ops; + child->backup_ops = child->ops; child->msi = parent->msi; child->sysdata = parent->sysdata; child->bus_flags = parent->bus_flags; diff --git a/include/linux/pci.h b/include/linux/pci.h index 1221ff86affad9298e9399f5c6994a9b150964d4..c97de5c8bc3580a0e7ec92c8e2fa221b99cfa58f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -584,6 +584,7 @@ struct pci_bus { struct resource busn_res; /* Bus numbers routed to this bus */ struct pci_ops *ops; /* Configuration access functions */ + struct pci_ops *backup_ops; struct msi_controller *msi; /* MSI controller */ void *sysdata; /* Hook for sys-specific extension */ struct proc_dir_entry *procdir; /* Directory entry in /proc/bus/pci */