From: Michael Chan <michael.chan@broadcom.com>
To: kuba@kernel.org
Cc: netdev@vger.kernel.org, gospo@broadcom.com,
Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Subject: [PATCH net 1/5] bnxt_en: Fix regression in workqueue cleanup logic in bnxt_remove_one().
Date: Mon, 26 Oct 2020 00:18:17 -0400 [thread overview]
Message-ID: <1603685901-17917-2-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1603685901-17917-1-git-send-email-michael.chan@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 1739 bytes --]
From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
A recent patch has moved the workqueue cleanup logic before
calling unregister_netdev() in bnxt_remove_one(). This caused a
regression because the workqueue can be restarted if the device is
still open. Workqueue cleanup must be done after unregister_netdev().
The workqueue will not restart itself after the device is closed.
Call bnxt_cancel_sp_work() after unregister_netdev() and
call bnxt_dl_fw_reporters_destroy() after that. This fixes the
regession and the original NULL ptr dereference issue.
Fixes: b16939b59cc0 ("bnxt_en: Fix NULL ptr dereference crash in bnxt_fw_reset_task()")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index fa147865e33f..e4e5ea080391 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -12108,15 +12108,16 @@ static void bnxt_remove_one(struct pci_dev *pdev)
if (BNXT_PF(bp))
bnxt_sriov_disable(bp);
+ if (BNXT_PF(bp))
+ devlink_port_type_clear(&bp->dl_port);
+ pci_disable_pcie_error_reporting(pdev);
+ unregister_netdev(dev);
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
+ /* Flush any pending tasks */
bnxt_cancel_sp_work(bp);
bp->sp_event = 0;
bnxt_dl_fw_reporters_destroy(bp, true);
- if (BNXT_PF(bp))
- devlink_port_type_clear(&bp->dl_port);
- pci_disable_pcie_error_reporting(pdev);
- unregister_netdev(dev);
bnxt_dl_unregister(bp);
bnxt_shutdown_tc(bp);
--
2.18.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4166 bytes --]
next prev parent reply other threads:[~2020-10-26 4:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 4:18 [PATCH net 0/5] bnxt_en: Bug fixes Michael Chan
2020-10-26 4:18 ` Michael Chan [this message]
2020-10-26 4:18 ` [PATCH net 2/5] bnxt_en: Invoke cancel_delayed_work_sync() for PFs also Michael Chan
2020-10-26 4:18 ` [PATCH net 3/5] bnxt_en: Re-write PCI BARs after PCI fatal error Michael Chan
2020-10-26 4:18 ` [PATCH net 4/5] bnxt_en: Check abort error state in bnxt_open_nic() Michael Chan
2020-10-26 4:18 ` [PATCH net 5/5] bnxt_en: Send HWRM_FUNC_RESET fw command unconditionally Michael Chan
2020-10-27 1:36 ` [PATCH net 0/5] bnxt_en: Bug fixes Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1603685901-17917-2-git-send-email-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=gospo@broadcom.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vasundhara-v.volam@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).