Received: by 10.213.65.68 with SMTP id h4csp2153925imn; Sun, 8 Apr 2018 21:06:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx48X3uJndkLlwyCxR60THqx8hWnNj4fZhFl81d1BwvWIJuuY/CguwVgIpnKs0pAGk22C5BKe X-Received: by 2002:a17:902:748a:: with SMTP id h10-v6mr3269675pll.160.1523246777588; Sun, 08 Apr 2018 21:06:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523246777; cv=none; d=google.com; s=arc-20160816; b=MDqT/Y6KVVLCMeXxsBuRABXDchXQwQh9qfEAZePF/9bWnChyOF+0BFE2qrkVLOTeO6 svDQ9XWPUkY9LVbtXmXv63u0EoVAfUHFhm7EgTHukCiZpMDyE7ookIhDtajgU7fjOAVb yKPV3bCU3JEApXa44Ae6D3c4anZ44Qwa9s+AnQFIC28/uyg49Ey7kGc3SLiGLZGmxBZF d7eoDJKeOg1ILTQtAY4Pb/K3HIxlLDNqXCd+f0LdSHy8zC8egIbXGTc3Kr3qnWoIFE5T t85fOf8nA13eNTygXn9tRGnmr2WWVTsqXUas3zBkp8jnn23sQSh757uf38XZwnqblQlX pGHg== 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=qY0Ti3R/tW1I50gcT4+ZHf2uTZ0BkFBKFuhSyyjkJDQ=; b=YhAt+Z82H/1Ekz/GrYzdoZa2so9CdpuSfR2RJt3NcyJT4NrAGpAJ/8j6/G7SWpq2/C Iir1GqDyAhvm8yTzp6oRBxASqQT4FHde3gyafhE4DxQ3Y1j/07RjiA71i1GEb9xR3YVT luDBmQITrkfhDFtt/jUgN1aOjvNu9PCEOXo7BJrZe9zZ1DncZc2Ek4h4ctWwurlXD8Gh mvUlRV4x+2Q2Nzpl3hWXQqaPlAb/+23/+S6ygn2RblFyFPm1KOTFQWZ96i9j0i7Qx5ym qQv5fejw5M/lcCIXFhJbwb6gbatyZJCSK5dmZRg4LrW3pGlVmAwS6Ur+d5MovMr9m5Kq LuFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Apwcbk5X; 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 z2si10462908pgz.328.2018.04.08.21.05.40; Sun, 08 Apr 2018 21:06:17 -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=Apwcbk5X; 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 S1754248AbeDID5H (ORCPT + 99 others); Sun, 8 Apr 2018 23:57:07 -0400 Received: from mail-bn3nam01on0092.outbound.protection.outlook.com ([104.47.33.92]:62923 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753731AbeDIASn (ORCPT ); Sun, 8 Apr 2018 20:18:43 -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=qY0Ti3R/tW1I50gcT4+ZHf2uTZ0BkFBKFuhSyyjkJDQ=; b=Apwcbk5Xsw314ZcjYZrhCTh4CkqkpHW6/fOa43q6L+B9zDtl3L62xcWY+a/2PRSyZhex+coGTmcJYQ0/viFTbV9rZX4AzMLLt/OyUqqGmBibwr2ZiOuEJWZiLBqg+ix8RBi+SqEtpDTZr3y1At1e1qEq3ua4wqYJM6lZ9ZnqYMk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1128.namprd21.prod.outlook.com (52.132.133.20) 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:18:37 +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:18:37 +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.15 078/189] i40evf: Don't schedule reset_task when device is being removed Thread-Topic: [PATCH AUTOSEL for 4.15 078/189] i40evf: Don't schedule reset_task when device is being removed Thread-Index: AQHTz5gv7WP1WG3qakGlpWyO9QiaLQ== Date: Mon, 9 Apr 2018 00:17:46 +0000 Message-ID: <20180409001637.162453-78-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB1128;7:Sbs26rnqlwXtoTpKxi7p5nr/6OpEJIqob7kuqfWNsGDnGeHEYYHi4tOu89CZ8ud8ojVr3rW2/g4djuXvnGLR0Ess8CMRUQsgeOVlvVZrqWl/aXuqCDj9JTuBGwGVa4DBq5Dhp5w3Hoevy4IsVosrpqL1KrR2ZWOXTnJqd3h/hqDatlFePuCbtTwRh4lGhearELBvF6cJHy3dOs5mz4pTHdu+12JK+/d54w9RUjsvEbV/MedYabh77/mmaGBVli3F;20:B4s3OIvZxn09ow8nXWVy7Szoh8ltgXNxVXJiHphP7hLtb3GE/dDbxgeM+vNA6k1ejSTllqhGEVPexDqSQrv4z0HjZe37CtajW7J0NRCg9h8w2gf9putNReQPcpxAJzWOKDf1+627/pNW3loLDpQ4U5nZL1acd/ykLVUJvlV2J3A= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 62423100-4cf2-4068-0ce1-08d59daf704b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1128; x-ms-traffictypediagnostic: DM5PR2101MB1128: 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)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1128;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1128; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(396003)(376002)(366004)(39380400002)(199004)(189003)(66066001)(86362001)(59450400001)(3660700001)(3280700002)(2900100001)(25786009)(36756003)(6506007)(76176011)(2906002)(6486002)(86612001)(99286004)(102836004)(1076002)(7736002)(575784001)(97736004)(2616005)(446003)(486006)(11346002)(476003)(26005)(305945005)(6666003)(6512007)(4326008)(107886003)(478600001)(6436002)(5660300001)(10290500003)(5250100002)(22452003)(316002)(105586002)(186003)(8676002)(110136005)(54906003)(72206003)(53936002)(2501003)(68736007)(14454004)(6116002)(8936002)(3846002)(81156014)(10090500001)(106356001)(81166006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1128;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: Q6Jq1UJspuMMBZ2lzSxGAs2vnRFdLLp+DY/a0mD1XjprtbQQ6BTw/HUENi9NndNQffWCRe/42k2QLGkIaH2dO4eNTFrGnrgQpyYbGZAeI05o0jG+LKGTYQ/N8ZzDjLORW5Ro6AVDeHQPB2aacdO6sG8p5s7CFDWX79kDwPkAMKj+RdlI5Ci6cRO+vOGrxyngHiJyDfGMXGRymZFRuUYNLUHKl79z1PxmiuY2A7eu4dyLhMQsQNCRLq8vl7AihhC5BguT8y3plS5mCYfX56ROQ60wigN9k9snDQoCfeOmPWALY41tt7rNE2ZgJqQVJXl40RDl/518OKuRbtOF1LJ69DqV09BvsVXXdLX6RleVTS/whN9CKx4TDbTyc4opOqiM77O59cph0EvuHvvH3HwY1uzC+6ZKtAb5Ccnrj/h7nKQ= 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: 62423100-4cf2-4068-0ce1-08d59daf704b X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:46.5392 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1128 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 de0af521d602..ecf752cb8772 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf.h +++ b/drivers/net/ethernet/intel/i40evf/i40evf.h @@ -187,6 +187,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 7b2a4eba92e2..1fe466c7849a 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c @@ -1855,6 +1855,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); @@ -3066,7 +3072,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