On Thu, 2014-05-01 at 12:02 -0600, Bjorn Helgaas wrote: > On Thu, May 1, 2014 at 8:35 AM, Marcel Apfelbaum <marcel.a@xxxxxxxxxx> wrote: > > When a board is added, the shpchp driver checks if there > > is a mismatch between the bridge's adapter and the bus speed. > > If there is, it sets the subordinate speed (if there is no device on it). > > > > However, it takes the reference of the board speed from the primary bus > > and not from the subordinate. If the primary bus is PCI and not PCIX/PCIe, > > its speed is not updated and remains 0xff. As a result hotplug fails > > with error: "Speed of bus ff and adapter 0 mismatch". > > It'd be cool to have a bugzilla for this with lspci and dmesg output. > I'll also have to check the other hotplug drivers for similar issues, > unless you've already done that. I'll open a BZ with the details, sure. I didn't check the other hotplug drivers, but I do plan to look into PCIe driver as part of QEMU's PCIe hotplug feature. Thanks, Marcel > > > Fixed that by checking the speed against the subordinate bus. > > > > Signed-off-by: Marcel Apfelbaum <marcel.a@xxxxxxxxxx> > > Acked-by: Michael S. Tsirkin <mst@xxxxxxxxxx> > > --- > > drivers/pci/hotplug/shpchp_ctrl.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c > > index 5849927..6efc2ec 100644 > > --- a/drivers/pci/hotplug/shpchp_ctrl.c > > +++ b/drivers/pci/hotplug/shpchp_ctrl.c > > @@ -282,8 +282,8 @@ static int board_added(struct slot *p_slot) > > return WRONG_BUS_FREQUENCY; > > } > > > > - bsp = ctrl->pci_dev->bus->cur_bus_speed; > > - msp = ctrl->pci_dev->bus->max_bus_speed; > > + bsp = ctrl->pci_dev->subordinate->cur_bus_speed; > > + msp = ctrl->pci_dev->subordinate->max_bus_speed; > > > > /* Check if there are other slots or devices on the same bus */ > > if (!list_empty(&ctrl->pci_dev->subordinate->devices)) > > -- > > 1.8.3.1 > > -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html