Skip to content

Commit

Permalink
spapr: Direct all PCI hotplug to host bridge, rather than P2P bridge
Browse files Browse the repository at this point in the history
A P2P bridge will attempt to handle the hotplug with SHPC, which doesn't
work in the PAPR environment.  Instead we want to direct all PCI hotplug
actions to the PAPR specific host bridge which will use the PAPR hotplug
mechanism.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
dgibson committed Jun 12, 2019
1 parent 05929a6 commit cb60008
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hw/ppc/spapr.c
Expand Up @@ -4094,6 +4094,17 @@ static HotplugHandler *spapr_get_hotplug_handler(MachineState *machine,
object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_PCI_HOST_BRIDGE)) {
return HOTPLUG_HANDLER(machine);
}
if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
PCIDevice *pcidev = PCI_DEVICE(dev);
PCIBus *root = pci_device_root_bus(pcidev);
SpaprPhbState *phb =
(SpaprPhbState *)object_dynamic_cast(OBJECT(BUS(root)->parent),
TYPE_SPAPR_PCI_HOST_BRIDGE);

if (phb) {
return HOTPLUG_HANDLER(phb);
}
}
return NULL;
}

Expand Down

0 comments on commit cb60008

Please sign in to comment.