Received: by 10.213.65.68 with SMTP id h4csp2202642imn; Sun, 8 Apr 2018 22:24:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/34JTok/4SslZo3UVALYBY9aUNTDNnJ8Ni9bUl12DML2co0hGB7xOLNBpfKclwm4KmZTAD X-Received: by 10.99.143.30 with SMTP id n30mr24717816pgd.213.1523251446249; Sun, 08 Apr 2018 22:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523251446; cv=none; d=google.com; s=arc-20160816; b=yOqlZDLA+8s6iQgdOdh2HpuBLMrHwN9BTOz/hzyT2aHxzDWKP13rAj0ISQ9B6O2VY9 FqSVmqdxsMzIf+wEVfqf7jpv7GEjDsE8nstGQiq2nfJYrDRKRmmYtrZ+zlkQDha2Il7m nlD+OM4vlXNHfEfBj7IDZvCQzKAcIviW0uQYMRsvvj/TWhTCg620AFgWlIkg0tqDvDmA +DMVTLMp4GyPsPv60tkcqCC9qo3jo7lbbQh0jj5jUXYz80BAGgy84sAofdMBf07z+Ns1 aM0HajnLkqCXVHx61hVAvIOVTJ/2cRONAqCFjIYAJcKLJjdJ1YNJw8uPVplsee4iUpxl O+Rg== 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=iKzLPo6ZM+ovtrQ/i2uHDgu/F2JaPfnlqIrb/QoW8+E=; b=SHFrxggsiFM5ud3syPQTmavI9Mox55F9OuOvgrZJW6Es90HkJ6ra8C0un9ZACNOzIz F5H9mXODJ0kocNsq8tChCNqXUb4mKsq6+XRV7nENruD+tCq2h9eSqC3C/vUIah3qB5P/ NAW3jjKQ2Rf870kI1uj0oBbquSALa3DOWp/wth2oKu/fg/m+/iN4IzEuJwglCY5lKNIZ DpYqOu3mv2oOzYU8bQ0DUg/Ly3kLPq4TOqWmSbkqkGOwjCDTiy81lkN5kw/gDyXPTBOk 5HN6R63CHHbgoVBVjjhS5z3Pxd2JnhtwfB7xNRrHRBPscb665mCZwzOt5KMiHSLWGeSY bDoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=g/yPspdO; 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 x9-v6si4396512plr.64.2018.04.08.22.23.29; Sun, 08 Apr 2018 22:24:06 -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=g/yPspdO; 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 S1754954AbeDIAXv (ORCPT + 99 others); Sun, 8 Apr 2018 20:23:51 -0400 Received: from mail-by2nam03on0115.outbound.protection.outlook.com ([104.47.42.115]:29467 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754916AbeDIAXq (ORCPT ); Sun, 8 Apr 2018 20:23:46 -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=iKzLPo6ZM+ovtrQ/i2uHDgu/F2JaPfnlqIrb/QoW8+E=; b=g/yPspdOv8s5Oyb5dj5fxfvJmmu42qqtKysN9t3zaflA7Q8uQ4tbrE1J/f+bsiFiofOg8EENhvv7+3d0x4DbdpnNfUzuI2LT3hhfX7CvZkdON8JiZbm2JBYQrJlh+vWRlfzWqceUA91ys42xFuw6ssnHQlfhQvMYFZdS4jFEfI4= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1080.namprd21.prod.outlook.com (52.132.130.14) 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:23:43 +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:23:43 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Avinash Dayanand , Jeff Kirsher , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 066/161] i40evf: Don't schedule reset_task when device is being removed Thread-Topic: [PATCH AUTOSEL for 4.14 066/161] i40evf: Don't schedule reset_task when device is being removed Thread-Index: AQHTz5iWCmiUEq3JfUC20uyt14TAwQ== Date: Mon, 9 Apr 2018 00:20:39 +0000 Message-ID: <20180409001936.162706-66-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB1080;7:s+ggwuVI0RsK/VgUuZrjq2zZwywMaxxDUHBd0VHoVm14RAP70hD72/YWAYt3HrehcrtBe71rQTzGE6th1RwXIpHFUl6Yh327fqIcV3qU4Zvz0kNlLvg+PxKPkvixBHDzqNP9wC+Uqdzku2zQCFQ7cAi81BZlJLzg2YLsUh97FxDa9C2i4CCTm4zoCHx2RD9bdHn1vtVfHbNgR6kKion2xzNj7ZitWQ6LfH+u55E6tBHNFMy4WM7p6ZbjAn09CKWK;20:XM9xuRdag6S4TCDLRFUiglBe8pOV+vC3lANjl3DPXHWLR7N2Q/mMSA9DsJH7n5y7Rb4ba8M073GFiBQf1kvJG1gdUkPmUq6Y40dyD7AlYZ6hvwHYvtH3sahTQ2PblIroTcB63zIGcrgqyN2W3CLVNssUb952vTVftVs5av5BJGQ= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 4f75b4a1-85f6-43e2-1932-08d59db026e8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1080; x-ms-traffictypediagnostic: DM5PR2101MB1080: 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)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231221)(944501327)(52105095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB1080;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1080; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(396003)(39380400002)(366004)(39860400002)(199004)(189003)(2501003)(5250100002)(8936002)(10090500001)(5660300001)(3660700001)(446003)(107886003)(14454004)(36756003)(6436002)(476003)(3280700002)(2616005)(11346002)(4326008)(6666003)(53936002)(6512007)(22452003)(305945005)(10290500003)(316002)(102836004)(2906002)(6116002)(66066001)(6506007)(3846002)(7736002)(486006)(54906003)(110136005)(186003)(72206003)(26005)(1076002)(105586002)(2900100001)(6486002)(97736004)(478600001)(81156014)(81166006)(86612001)(8676002)(106356001)(99286004)(86362001)(76176011)(59450400001)(68736007)(25786009)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1080;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: JbcIZuTAHnkLEikxQLqoq1GmkH5Y7sbHCcD19i448yHi8Dn2iEg4H/sag855AxZGk2OijpWB2dVUn5IjLDEU1THp0XKQEdKYANa0H9smMuEsced63Xo2lXDgSFSY8DthBzJRboF064HlWQVEnOrRtkw/miGYBoR3KC3nuXSHjWrTb2n+YKP2+r9WGTop4vlJRVW/p/3U+K86eZYWUhED3L7VFT4V5GRGImIAD23Y1ruxFOgbqvgosTZ6hN88jK9iaFkWqb4YrYlkhc6IhIsMfhwcPSrsPqrtW/3WxJTT2C/j2z3BrmA5GyKZQXvX5b9xt0NDf/LZe8eIrgEdj1fxPuZ/C2W4BW3kt+LNpt368U/J4teDXz+mlIV79SUb2/meuOKJCBXzqkXTHYndW3LQ+Eq2AbXBq9ax129jKvruPOI= 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: 4f75b4a1-85f6-43e2-1932-08d59db026e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:20:40.0035 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1080 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Avinash Dayanand [ Upstream commit 06aa040f039404a0039a5158cd12f41187487a1f ] When a host disables and enables a PF device, all the associated VFs are removed and added back in. It also generates a PFR which in turn resets all the connected VFs. This behaviour is different from that of Linux guest on Linux host. Hence we end up in a situation where there's a PFR and device removal at the same time. And watchdog doesn't have a clue about this and schedules a reset_task. This patch adds code to send signal to reset_task that the device is currently being removed. Signed-off-by: Avinash Dayanand Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40evf/i40evf.h | 1 + drivers/net/ethernet/intel/i40evf/i40evf_main.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ether= net/intel/i40evf/i40evf.h index 82f69031e5cd..2ef32ab1dfae 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf.h +++ b/drivers/net/ethernet/intel/i40evf/i40evf.h @@ -186,6 +186,7 @@ enum i40evf_state_t { enum i40evf_critical_section_t { __I40EVF_IN_CRITICAL_TASK, /* cannot be interrupted */ __I40EVF_IN_CLIENT_TASK, + __I40EVF_IN_REMOVE_TASK, /* device being removed */ }; =20 /* board specific private data structure */ diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/= ethernet/intel/i40evf/i40evf_main.c index 1ccad6f30ebf..048c92a1436a 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c @@ -1834,6 +1834,12 @@ static void i40evf_reset_task(struct work_struct *wo= rk) u32 reg_val; int i =3D 0, err; =20 + /* When device is being removed it doesn't make sense to run the reset + * task, just return in such a case. + */ + if (test_bit(__I40EVF_IN_REMOVE_TASK, &adapter->crit_section)) + return; + while (test_and_set_bit(__I40EVF_IN_CLIENT_TASK, &adapter->crit_section)) usleep_range(500, 1000); @@ -3008,7 +3014,8 @@ static void i40evf_remove(struct pci_dev *pdev) struct i40evf_mac_filter *f, *ftmp; struct i40e_hw *hw =3D &adapter->hw; int err; - + /* Indicate we are in remove and not to run reset_task */ + set_bit(__I40EVF_IN_REMOVE_TASK, &adapter->crit_section); cancel_delayed_work_sync(&adapter->init_task); cancel_work_sync(&adapter->reset_task); cancel_delayed_work_sync(&adapter->client_task); --=20 2.15.1