Received: by 10.213.65.68 with SMTP id h4csp2118348imn; Sun, 8 Apr 2018 20:09:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx48qI+Lr6pmLPfJsaac1qVO8kgjDIJ0BFfyslRvBzRxXQBAaKtMOWfqsqFDX4peZ2LlC4/B3 X-Received: by 2002:a17:902:6b04:: with SMTP id o4-v6mr18580946plk.332.1523243380504; Sun, 08 Apr 2018 20:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243380; cv=none; d=google.com; s=arc-20160816; b=jj8r7Mig83mPnnTGHKjnI7mIckuIdMs0tNmR6w2p6u8OMR0nOVNaoZC8VUYxxqPYny 4pkmlCsNWMman3khGRPAhd0hYv704VbvZe0m9l+d7JskTzvYhJSX3rISA7GHCG/WkCoD l/GyTMSfQqPfwb+tdVkl/sjhygJt7OATpaVP1CRcQuwhPTUoPJel58lZpsPpr+Mn3O9B sFZGiti5RWzhrfW/0a0AcgVJGhnXkzFMYE8Ge0kJ42i1WfoIDUF+Cj2EEZEOcDG0s1cy bYJIO9PQ6+F2N1CXkpfp1pTOTRg8cunOvvtDemAEagye28DzkNnDy33pbIU4M+7W6jFD ps6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=SjU0ayZ9q8x3frxV9w7H/1/Qhg1eusCAHKjrJcYLx+o=; b=chN/04gHCOOFdwPadDeCxM/Pc9QS/pyexEqdXA4jCL18e5LwEWRqfoLpQ8HVRGcLtM /YqELMfC/HQhSiN/1N+H5yTBWKlrL2bRQpg6wC1rARvDRCfcf7Yvu5Rg4wlHn+Dbvg1C SRpu0PYdgghoPdHumUnNISabLDR1H1gKrKvZ2sk9aDY/8IccartdtPj3jr3DSdKHdOf+ 4ZEYkQpiZdonUMEpiIWoFI0t6gl8kc7ngZo1uRBdSmycMp69sjTzplQwQSJe33qvWE1F xfxyj0kfx7fLVHCGDXSp3rmEQZoc0Bya4dTjA03Z/gX7v+9ohQlkgrUvH3ZV2D6NzjQW 7gow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=niSeZHCl; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si7013056pfa.148.2018.04.08.20.09.03; Sun, 08 Apr 2018 20:09:40 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=niSeZHCl; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757689AbeDICkc (ORCPT + 99 others); Sun, 8 Apr 2018 22:40:32 -0400 Received: from mail-cys01nam02on0094.outbound.protection.outlook.com ([104.47.37.94]:22752 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755533AbeDIA1X (ORCPT ); Sun, 8 Apr 2018 20:27:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SjU0ayZ9q8x3frxV9w7H/1/Qhg1eusCAHKjrJcYLx+o=; b=niSeZHClixFNAEEwVqXn/5QYDha2QKg39Rd77ob6Ix8j9SsS8lN3YbZ9zbuf65+6k23vebzRE5SXDrDtHQNCAAhBzN8rOfUVQFGYuGQ7H1wUFeJuVtCJP5+q/3CDuJg0Q70H8q+Onq5BoQKSya7q9u16IV7iZmLwUf2PPsDejUQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1031.namprd21.prod.outlook.com (52.132.128.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:27:20 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:27:20 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Netanel Belgazal , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 035/293] net: ena: add missing unmap bars on device removal Thread-Topic: [PATCH AUTOSEL for 4.9 035/293] net: ena: add missing unmap bars on device removal Thread-Index: AQHTz5j0GBEP8VNMnkS0s5Rn2WkHdQ== Date: Mon, 9 Apr 2018 00:23:17 +0000 Message-ID: <20180409002239.163177-35-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1031;7:hdgnsVmn8WmWl65vmTVUyLFguQa7QOxTQvcXC8wJ8OH6yZHiFNbVwNk9lC1oIyBXQo05t2VcGmQbZ8lpSzJVjN5EYQXcFUNkb22nDhNPvJy60y6Yghz+IPbporGT0xEXNXxb5mHTo5lEm/RZOPjXLLGgtqHWZOaWkK6dWyRBDHfpcp3ZPe/6xIuhw3k0/ou9GGJqPHUIN0R5IIuS4ENtGHR5cI5hlWPbsMoaPNcPhnN+qmmMkNA992q/1UVMTEwC;20:7yHQqz4duiXFpbbUAqMumV4bFl7c/fB5emjZ6hKpVgnnnko5cGS/Ztxu66e9K4gQFpbifqHdj/t3opj8zE/eyhFbZScsEAcATI7G83KTlLb55KFNFGNU6Xa14I7fHqyazY3UpdCgxnvpBmt3JTnZoLNNyB0YTCXpJbWvApgxMWM= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: e014ef49-ef2b-42b6-46f0-08d59db0a804 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1031; x-ms-traffictypediagnostic: DM5PR2101MB1031: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(33061846794335)(47284530071512); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1031;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1031; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(376002)(366004)(39380400002)(346002)(39860400002)(189003)(199004)(2900100001)(10290500003)(99286004)(76176011)(14454004)(7736002)(11346002)(26005)(6666003)(86612001)(72206003)(478600001)(36756003)(106356001)(66066001)(2616005)(186003)(22452003)(86362001)(68736007)(305945005)(54906003)(102836004)(486006)(110136005)(316002)(6506007)(446003)(107886003)(53936002)(4326008)(105586002)(6436002)(6486002)(476003)(6512007)(5660300001)(5250100002)(25786009)(3846002)(6116002)(1076002)(97736004)(3280700002)(2501003)(2906002)(81156014)(8676002)(10090500001)(81166006)(8936002)(3660700001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1031;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: CA3ADfCkFmmqvcnm4pM0dk09qAtT+jfbSXzo7omO4i6DGxhRA5q+3RPtD8MYJAYaxA4iMZkX4FKzoE7VXdeZ6UU8KNlUR7GNTiJv5SI+FJwLoGQBHkTIYPOqzjSHmw4rYGrArmbC/bGKFJzma1ZG/5wqwDNTOl/ad3V/wX4MWNgt1aIBZjJx0hiFeL8/ESPTz3f3a3aINE7pKH46LjkiwkCcEa+ioKsF/e5YpT4oqf2jJPAqgQ7bFj3TsowYPtFJZeJOVBxT+/CEw3b3ExAgH60TyKUq9y71Nejz2LETIUc4HFV/otBfId0EKYppl/JWsJ3iZlfOgddiMFxFBKOdamQBEOVGCu1+HWNFV6wLIziregXbkR0i+RP4PJxTa/QB2ZiSjqk60PTPQrOvtn+tYM9TjBHWKWeiSWdXXagaZIA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: e014ef49-ef2b-42b6-46f0-08d59db0a804 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:17.4404 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1031 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Netanel Belgazal [ Upstream commit 0857d92f71b6cb75281fde913554b2d5436c394b ] This patch also change the mapping functions to devm_ functions Fixes: 1738cd3ed342 ("Add a driver for Amazon Elastic Network Adapters (ENA= )") Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/eth= ernet/amazon/ena/ena_netdev.c index fe691017d5aa..0d9ce08ee3a9 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -2808,6 +2808,11 @@ static void ena_release_bars(struct ena_com_dev *ena= _dev, struct pci_dev *pdev) { int release_bars; =20 + if (ena_dev->mem_bar) + devm_iounmap(&pdev->dev, ena_dev->mem_bar); + + devm_iounmap(&pdev->dev, ena_dev->reg_bar); + release_bars =3D pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK; pci_release_selected_regions(pdev, release_bars); } @@ -2895,8 +2900,9 @@ static int ena_probe(struct pci_dev *pdev, const stru= ct pci_device_id *ent) goto err_free_ena_dev; } =20 - ena_dev->reg_bar =3D ioremap(pci_resource_start(pdev, ENA_REG_BAR), - pci_resource_len(pdev, ENA_REG_BAR)); + ena_dev->reg_bar =3D devm_ioremap(&pdev->dev, + pci_resource_start(pdev, ENA_REG_BAR), + pci_resource_len(pdev, ENA_REG_BAR)); if (!ena_dev->reg_bar) { dev_err(&pdev->dev, "failed to remap regs bar\n"); rc =3D -EFAULT; @@ -2916,8 +2922,9 @@ static int ena_probe(struct pci_dev *pdev, const stru= ct pci_device_id *ent) ena_set_push_mode(pdev, ena_dev, &get_feat_ctx); =20 if (ena_dev->tx_mem_queue_type =3D=3D ENA_ADMIN_PLACEMENT_POLICY_DEV) { - ena_dev->mem_bar =3D ioremap_wc(pci_resource_start(pdev, ENA_MEM_BAR), - pci_resource_len(pdev, ENA_MEM_BAR)); + ena_dev->mem_bar =3D devm_ioremap_wc(&pdev->dev, + pci_resource_start(pdev, ENA_MEM_BAR), + pci_resource_len(pdev, ENA_MEM_BAR)); if (!ena_dev->mem_bar) { rc =3D -EFAULT; goto err_device_destroy; --=20 2.15.1