On Tue, Jul 23, 2013 at 7:04 PM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote: > On Tue, Jul 23, 2013 at 7:01 PM, Yijing Wang <wangyijing@xxxxxxxxxx> wrote: >> Hi Yinghai, >> It seems to have the the same problem in acpiphp, >> >> diable_device(..): >> >> while ((pdev = dev_in_slot(slot))) { >> pci_stop_and_remove_bus_device(pdev); >> pci_dev_put(pdev); >> } >> >> >> static struct pci_dev *dev_in_slot(struct acpiphp_slot *slot) >> { >> struct pci_bus *bus = slot->bridge->pci_bus; >> struct pci_dev *dev; >> struct pci_dev *ret = NULL; >> >> down_read(&pci_bus_sem); >> list_for_each_entry(dev, &bus->devices, bus_list) >> if (PCI_SLOT(dev->devfn) == slot->device) { >> ret = pci_dev_get(dev); >> break; >> } >> up_read(&pci_bus_sem); >> > > acpiphp is ok. > > dev_in_slot will restart from bus->devices again every time. Actually I had another version to fix the problem, but I did not even try to compile and to test it after i figured out that mlx4_core like to VF get stopped before PF's driver. Thanks Yinghai
Attachment:
fix_cx3_hotplug_1x.patch
Description: Binary data