From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Guo Subject: [PATCH V8 2/3] igb_uio: fix device removal issuse for hotplug Date: Wed, 10 Jan 2018 11:30:36 +0800 Message-ID: <1515555037-9419-3-git-send-email-jia.guo@intel.com> References: <1514943736-5931-3-git-send-email-jia.guo@intel.com> <1515555037-9419-1-git-send-email-jia.guo@intel.com> Cc: konstantin.ananyev@intel.com, jblunck@infradead.org, shreyansh.jain@nxp.com, jingjing.wu@intel.com, dev@dpdk.org, jia.guo@intel.com, thomas@monjalon.net, helin.zhang@intel.com, motih@mellanox.com To: stephen@networkplumber.org, bruce.richardson@intel.com, ferruh.yigit@intel.com, gaetan.rivet@6wind.com Return-path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 5A0AD1B1A3 for ; Tue, 9 Jan 2018 12:31:01 +0100 (CET) In-Reply-To: <1515555037-9419-1-git-send-email-jia.guo@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" when the hot plug out of the device, the uio resource have been invalid, so to avoid the system hung, no need to do the invalid operation in igb_uio pci release function. Signed-off-by: Jeff Guo --- lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index a3a98c1..d0e07b4 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -354,6 +354,12 @@ igbuio_pci_release(struct uio_info *info, struct inode *inode) struct rte_uio_pci_dev *udev = info->priv; struct pci_dev *dev = udev->pdev; + /* check if device have been remove before release */ + if ((&dev->dev.kobj)->state_remove_uevent_sent == 1) { + pr_info("The device have been removed\n"); + return -1; + } + /* disable interrupts */ igbuio_pci_disable_interrupts(udev); -- 2.7.4