]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Invoke cancel_delayed_work_sync() for PFs also.
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Mon, 26 Oct 2020 04:18:18 +0000 (00:18 -0400)
committerJakub Kicinski <kuba@kernel.org>
Tue, 27 Oct 2020 01:26:35 +0000 (18:26 -0700)
commit76e615b75497c756b7ae469a386d5d9aa6998bca
tree90ad91416c4d33b73cfa9987f89e75e37236fb6b
parenta7455b379e5cb0251cb8614c81c36c79ee8bfe1e
bnxt_en: Invoke cancel_delayed_work_sync() for PFs also.

As part of the commit 4d84fed0e91e
("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: 4d84fed0e91e ("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>
drivers/net/ethernet/broadcom/bnxt/bnxt.c