Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1985116pxx; Sat, 31 Oct 2020 04:52:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0RVnB+f4qiwcfegF/jI49DAb/bmQ6WSMJpDoo68ount4xxysDpRh8r6na++C5WlJAioZS X-Received: by 2002:a05:6402:395:: with SMTP id o21mr7162161edv.2.1604145149330; Sat, 31 Oct 2020 04:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604145149; cv=none; d=google.com; s=arc-20160816; b=W7nmRJV3+f0nFDHN+i9f97K+0VcRIkKZqq5Ye3X5ARi0+6v44y/Oy1GY5aTfEvL70G bFz3gV7FfDMOyeXJ3eCQ59cqwDau2kxFxSiHM7fPjj5Is7niKJlKAc/6yxzzja6GVfqE SX79N7Ml4UnBFAs7LvW6aY2biovuNd+ObpAOhstO67/LNq2qrZZcoKA7aZafWsj9kN7R r7cR6JxQD2yHR58i9U6+3QcK/VdlvGxmIt5LQmtmBKw4YaMFai3mncCMVrFawxCdr4aI Gj07vJqBRKLzqQFNg0PgCNUnlvHUey2uR5DmAmvOY0fJugM2LT29FI1oUut1uWYdox3g s8eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EV7hrTovbMz6RVm9AOEH5H/kC8oE/JupacBNBfsJc5o=; b=GvH7NYDXLsB5mmK0bXCqbxWV8l3tez5l6YuSXa0RPpWGSYSz/ciSlU/QTx2KNQn/zU F26nChrqxxfwbxKZZ6E8uV+XRFZUbrt+7jHslTEK43BbCLbiIJf9C4neUf5rYS/k10Qk G7vDvEQ0zB0+z8Cp0AvRYkxWQB4wgIK3AuP3Y4uOhI5VcQWce9OO23Z2cSVYm97p4JaY ODyceVhrKTmCMv7jV4IiTMbo/sYiHXn2G4YaNg1/okEvWA37tJ2tIacrtiVkA9BV3hum H0EIl03Ky40CW0MLxJ1hv/Hbc9LN6bFh6CyFROUpEr/RwOUbLHLYGCqvMWShnW/89Ncu ymOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iDA7neaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si6295171ejj.396.2020.10.31.04.52.06; Sat, 31 Oct 2020 04:52:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iDA7neaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727865AbgJaLuk (ORCPT + 99 others); Sat, 31 Oct 2020 07:50:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:40062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727557AbgJaLlG (ORCPT ); Sat, 31 Oct 2020 07:41:06 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6682A20719; Sat, 31 Oct 2020 11:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604144465; bh=+dV7zKMCtQeqweqoZJb+NFUfm5NUKGcJfJ2EYFpQNPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iDA7neaQmRaA/sZD7s14lxQnko9vxYemkwkDRNfmFWW9xEDjgRbik4gPCFwI3AkS5 uaWEiSAbv9C0UlMR7M1QaTgNALsABavtg0NQ84/HyQLdML+OsVrSmrnEg4JngvaOW0 /ObZTC+VV9SvImnoymK3DCuiCM1+iPaphkN/W9hg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavan Chebbi , Andy Gospodarek , Vasundhara Volam , Michael Chan , Jakub Kicinski Subject: [PATCH 5.8 29/70] bnxt_en: Invoke cancel_delayed_work_sync() for PFs also. Date: Sat, 31 Oct 2020 12:36:01 +0100 Message-Id: <20201031113500.899120794@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201031113459.481803250@linuxfoundation.org> References: <20201031113459.481803250@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasundhara Volam [ Upstream commit 631ce27a3006fc0b732bfd589c6df505f62eadd9 ] As part of the commit b148bb238c02 ("bnxt_en: Fix possible crash in bnxt_fw_reset_task()."), cancel_delayed_work_sync() is called only for VFs to fix a possible crash by cancelling any pending delayed work items. It was assumed by mistake that the flush_workqueue() call on the PF would flush delayed work items as well. As flush_workqueue() does not cancel the delayed workqueue, extend the fix for PFs. This fix will avoid the system crash, if there are any pending delayed work items in fw_reset_task() during driver's .remove() call. Unify the workqueue cleanup logic for both PF and VF by calling cancel_work_sync() and cancel_delayed_work_sync() directly in bnxt_remove_one(). Fixes: b148bb238c02 ("bnxt_en: Fix possible crash in bnxt_fw_reset_task().") Reviewed-by: Pavan Chebbi Reviewed-by: Andy Gospodarek Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -1158,16 +1158,6 @@ static void bnxt_queue_sp_work(struct bn schedule_work(&bp->sp_task); } -static void bnxt_cancel_sp_work(struct bnxt *bp) -{ - if (BNXT_PF(bp)) { - flush_workqueue(bnxt_pf_wq); - } else { - cancel_work_sync(&bp->sp_task); - cancel_delayed_work_sync(&bp->fw_reset_task); - } -} - static void bnxt_sched_reset(struct bnxt *bp, struct bnxt_rx_ring_info *rxr) { if (!rxr->bnapi->in_reset) { @@ -11514,7 +11504,8 @@ static void bnxt_remove_one(struct pci_d unregister_netdev(dev); clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state); /* Flush any pending tasks */ - bnxt_cancel_sp_work(bp); + cancel_work_sync(&bp->sp_task); + cancel_delayed_work_sync(&bp->fw_reset_task); bp->sp_event = 0; bnxt_dl_fw_reporters_destroy(bp, true);