Skip to content

Commit 0123694

Browse files
Vasundhara Volamgregkh
authored andcommitted
bnxt_en: Invoke cancel_delayed_work_sync() for PFs also.
[ Upstream commit 631ce27 ] As part of the commit b148bb2 ("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: b148bb2 ("bnxt_en: Fix possible crash in bnxt_fw_reset_task().") Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Reviewed-by: Andy Gospodarek <gospo@broadcom.com> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9959fda commit 0123694

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

  • drivers/net/ethernet/broadcom/bnxt

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,16 +1158,6 @@ static void bnxt_queue_sp_work(struct bnxt *bp)
11581158
schedule_work(&bp->sp_task);
11591159
}
11601160

1161-
static void bnxt_cancel_sp_work(struct bnxt *bp)
1162-
{
1163-
if (BNXT_PF(bp)) {
1164-
flush_workqueue(bnxt_pf_wq);
1165-
} else {
1166-
cancel_work_sync(&bp->sp_task);
1167-
cancel_delayed_work_sync(&bp->fw_reset_task);
1168-
}
1169-
}
1170-
11711161
static void bnxt_sched_reset(struct bnxt *bp, struct bnxt_rx_ring_info *rxr)
11721162
{
11731163
if (!rxr->bnapi->in_reset) {
@@ -11796,7 +11786,8 @@ static void bnxt_remove_one(struct pci_dev *pdev)
1179611786
unregister_netdev(dev);
1179711787
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
1179811788
/* Flush any pending tasks */
11799-
bnxt_cancel_sp_work(bp);
11789+
cancel_work_sync(&bp->sp_task);
11790+
cancel_delayed_work_sync(&bp->fw_reset_task);
1180011791
bp->sp_event = 0;
1180111792

1180211793
bnxt_dl_fw_reporters_destroy(bp, true);

0 commit comments

Comments
 (0)