From: Jeff Guo Date: Thu, 18 Oct 2018 06:27:15 +0000 (+0800) Subject: igb_uio: fix unexpected removal for hot-unplug X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=70efa4116420b6f7a0734711dd603d3024366c79 igb_uio: fix unexpected removal for hot-unplug When a device is hot-unplugged, pci_remove will be invoked unexpectedly before pci_release, it will caused kernel hung issue which will throw the error info of "Trying to free already-free IRQ XXX". And on the other hand, if pci_remove before pci_release, the interrupt will not got chance to be disabled. So this patch aim to fix this issue by adding pci_release call in pci_remove, it will gurranty that all pci clean up will be done before pci removal. Signed-off-by: Jeff Guo Acked-by: Ferruh Yigit --- diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c index fede66cf27..3cf394bdf7 100644 --- a/kernel/linux/igb_uio/igb_uio.c +++ b/kernel/linux/igb_uio/igb_uio.c @@ -570,6 +570,8 @@ igbuio_pci_remove(struct pci_dev *dev) { struct rte_uio_pci_dev *udev = pci_get_drvdata(dev); + igbuio_pci_release(&udev->info, NULL); + sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp); uio_unregister_device(&udev->info); igbuio_pci_release_iomem(&udev->info);