From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 39C125F27 for ; Thu, 18 Oct 2018 08:30:28 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2018 23:30:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,395,1534834800"; d="scan'208";a="100227717" Received: from jeffguo-z170x-ud5.sh.intel.com ([10.67.104.10]) by fmsmga001.fm.intel.com with ESMTP; 17 Oct 2018 23:30:25 -0700 From: Jeff Guo To: stephen@networkplumber.org, bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, thomas@monjalon.net, shaopeng.he@intel.com Cc: dev@dpdk.org, jia.guo@intel.com, helin.zhang@intel.com Date: Thu, 18 Oct 2018 14:27:15 +0800 Message-Id: <1539844035-11524-1-git-send-email-jia.guo@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534502916-31636-9-git-send-email-jia.guo@intel.com> References: <1534502916-31636-9-git-send-email-jia.guo@intel.com> Subject: [dpdk-dev] [PATCH v1] igb_uio: fix unexpected removal for hot-unplug X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2018 06:30:28 -0000 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 --- kernel/linux/igb_uio/igb_uio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c index fede66c..3cf394b 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); -- 2.7.4