From patchwork Tue May 15 18:20:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 135920 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1371995lji; Tue, 15 May 2018 11:21:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZocpnKGFf66Y+SF4n28LfQwQBN5OPd103QcpyCPdu2PPIEL7++2jlMswAjHLNfEIUANA/Pu X-Received: by 2002:a63:3756:: with SMTP id g22-v6mr13460994pgn.257.1526408510082; Tue, 15 May 2018 11:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526408510; cv=none; d=google.com; s=arc-20160816; b=CM33ACaWfzSh634WDWm4ni4CU+hFcpf+06BZQZJptNDgpg4Q8FddjoE5vA79K8jT0+ 7ciPKRQr2kLKhHfeZ4LdI+2xT8i2GX20ual1PWfP0tOOrA5TC69RL7BzJwnmmgtw0JXB d9hqR+YYi3gKWYq+2DreWXj2rGRa6bUMuJRMYnsJoUx5GZNCQ7X4ONa9EWBCGRFDWf76 xMknCxg86uR66VnZcdstcsBMnNMaXgXYFlsIy4jk274EaK5NAJhUrPwdcpLYI34AlpV6 l7TMJmVg7L4VoWs3B11XzDaoWCarVuOu3yiKtYhBcz77gP6uPMYJF1pjWyVsmZbaIEOm S1GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=TYlDJQwdft9RiuZQggMa5jjyI/r9E+JuLXyXewhSxPE=; b=kFsc0RrINKJ+5RDC8zz02bN9H6XFzp1gVaIy5Yy6fnFfBf51uwiJq3rNb5+rwXUrEa vfXDbhjzU8I+j5xJXxlOXe7OEqH6l1TBHOaIqBtaJ1EY3sFI4OmpabQ0xBLKp4+IYEP+ wPkNYo883Ylk+blmgNzI5DdAyhJ5ZiXV7LK60wd2TXKJ6oedlPElQI9mA1hogbK3brDk ax2VMmlcHUBsMutL6M+GQfhHvyp7Ge4IebvahLCFPsE/4cxdTkSdlralVk+pElMyMXje IG8XgLqYaNDnS/tbbsiI09wVadFXPD1IwTip3mlUPy+2e4l2DRHnsnQERZWBiNqX+rVS w76g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t13-v6si630373pfc.333.2018.05.15.11.21.49; Tue, 15 May 2018 11:21:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753872AbeEOSVs (ORCPT + 29 others); Tue, 15 May 2018 14:21:48 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7691 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752485AbeEOSVq (ORCPT ); Tue, 15 May 2018 14:21:46 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 29047E25116EB; Wed, 16 May 2018 02:21:32 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.382.0; Wed, 16 May 2018 02:21:24 +0800 From: Salil Mehta To: CC: , , , , , , , Fuyun Liang Subject: [PATCH net-next 10/10] net: hns3: Fixes the missing PCI iounmap for various legs Date: Tue, 15 May 2018 19:20:14 +0100 Message-ID: <20180515182014.42196-11-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180515182014.42196-1-salil.mehta@huawei.com> References: <20180515182014.42196-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang We call pcim_iomap in hclge_pci_init, pcim_iounmap should be called in error handle of hclge_init_ae_dev. We call pcim_iomap in hclge_pci_init, but do not call pcim_iounmap in hclge_pci_uninit. When we remove the hclge.ko and insert it again, a problem that pci can not map will happen. pcim_iounmap need to be called in hclge_pci_uninit. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 75d9b8c..46435c8 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5425,6 +5425,7 @@ static void hclge_pci_uninit(struct hclge_dev *hdev) { struct pci_dev *pdev = hdev->pdev; + pcim_iounmap(pdev, hdev->hw.io_base); pci_free_irq_vectors(pdev); pci_clear_master(pdev); pci_release_mem_regions(pdev); @@ -5589,6 +5590,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) err_cmd_uninit: hclge_destroy_cmd_queue(&hdev->hw); err_pci_uninit: + pcim_iounmap(pdev, hdev->hw.io_base); pci_clear_master(pdev); pci_release_regions(pdev); pci_disable_device(pdev);