This is a note to let you know that I've just added the patch titled [PATCH stable 5.8 03/22] bnxt_en: Invoke cancel_delayed_work_sync() for PFs also. to the 5.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bnxt_en-invoke-cancel_delayed_work_sync-for-pfs-also.patch and it can be found in the queue-5.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Sat Oct 31 09:06:02 AM CET 2020 From: Vasundhara Volam <vasundhara-v.volam@xxxxxxxxxxxx> Date: Mon, 26 Oct 2020 00:18:18 -0400 Subject: [PATCH stable 5.8 03/22] bnxt_en: Invoke cancel_delayed_work_sync() for PFs also. From: Vasundhara Volam <vasundhara-v.volam@xxxxxxxxxxxx> [ 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 <pavan.chebbi@xxxxxxxxxxxx> Reviewed-by: Andy Gospodarek <gospo@xxxxxxxxxxxx> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@xxxxxxxxxxxx> Signed-off-by: Michael Chan <michael.chan@xxxxxxxxxxxx> Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- 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); Patches currently in stable-queue which might be from vasundhara-v.volam@xxxxxxxxxxxx are queue-5.8/bnxt_en-check-abort-error-state-in-bnxt_open_nic.patch queue-5.8/bnxt_en-fix-regression-in-workqueue-cleanup-logic-in-bnxt_remove_one.patch queue-5.8/bnxt_en-re-write-pci-bars-after-pci-fatal-error.patch queue-5.8/bnxt_en-invoke-cancel_delayed_work_sync-for-pfs-also.patch queue-5.8/bnxt_en-send-hwrm_func_reset-fw-command-unconditionally.patch