Commit 7fe9514c authored by Vasundhara Volam's avatar Vasundhara Volam Committed by Greg Kroah-Hartman
Browse files

bnxt_en: Invoke cancel_delayed_work_sync() for PFs also.

[ 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

Fixes: b148bb238c02 ("bnxt_en: Fix possible crash in bnxt_fw_reset_task().")
Reviewed-by: default avatarPavan Chebbi <>
Reviewed-by: default avatarAndy Gospodarek <>
Signed-off-by: default avatarVasundhara Volam <>
Signed-off-by: default avatarMichael Chan <>
Signed-off-by: default avatarJakub Kicinski <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent bfbbfb50
......@@ -1158,16 +1158,6 @@ static void bnxt_queue_sp_work(struct bnxt *bp)
static void bnxt_cancel_sp_work(struct bnxt *bp)
if (BNXT_PF(bp)) {
} else {
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_dev *pdev)
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
/* Flush any pending tasks */
bp->sp_event = 0;
bnxt_dl_fw_reporters_destroy(bp, true);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment