From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, andrew+netdev@lunn.ch,
pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com,
Shravya KN <shravya.k-n@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>
Subject: [PATCH net 1/8] bnxt_en: Fix error handling path in bnxt_init_chip()
Date: Mon, 28 Apr 2025 15:58:56 -0700 [thread overview]
Message-ID: <20250428225903.1867675-2-michael.chan@broadcom.com> (raw)
In-Reply-To: <20250428225903.1867675-1-michael.chan@broadcom.com>
From: Shravya KN <shravya.k-n@broadcom.com>
WARN_ON() is triggered in __flush_work() if bnxt_init_chip() fails
because we call cancel_work_sync() on dim work that has not been
initialized.
WARNING: CPU: 37 PID: 5223 at kernel/workqueue.c:4201 __flush_work.isra.0+0x212/0x230
The driver relies on the BNXT_STATE_NAPI_DISABLED bit to check if dim
work has already been cancelled. But in the bnxt_open() path,
BNXT_STATE_NAPI_DISABLED is not set and this causes the error
path to think that it needs to cancel the uninitalized dim work.
Fix it by setting BNXT_STATE_NAPI_DISABLED during initialization.
The bit will be cleared when we enable NAPI and initialize dim work.
Fixes: 40452969a506 ("bnxt_en: Fix DIM shutdown")
Suggested-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Shravya KN <shravya.k-n@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 2c8e2c19d854..c4bccc683597 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11602,6 +11602,9 @@ static void bnxt_init_napi(struct bnxt *bp)
poll_fn = bnxt_poll_p5;
else if (BNXT_CHIP_TYPE_NITRO_A0(bp))
cp_nr_rings--;
+
+ set_bit(BNXT_STATE_NAPI_DISABLED, &bp->state);
+
for (i = 0; i < cp_nr_rings; i++) {
bnapi = bp->bnapi[i];
netif_napi_add_config_locked(bp->dev, &bnapi->napi, poll_fn,
--
2.30.1
next prev parent reply other threads:[~2025-04-28 22:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 22:58 [PATCH net 0/8] bnxt_en: Misc. bug fixes Michael Chan
2025-04-28 22:58 ` Michael Chan [this message]
2025-04-28 22:58 ` [PATCH net 2/8] bnxt_en: Fix ethtool selftest output in one of the failure cases Michael Chan
2025-04-28 22:58 ` [PATCH net 3/8] bnxt_en: Add missing skb_mark_for_recycle() in bnxt_rx_vlan() Michael Chan
2025-04-28 22:58 ` [PATCH net 4/8] bnxt_en: call pci_alloc_irq_vectors() after bnxt_reserve_rings() Michael Chan
2025-04-28 22:59 ` [PATCH net 5/8] bnxt_en: delay pci_alloc_irq_vectors() in the AER path Michael Chan
2025-04-28 22:59 ` [PATCH net 6/8] bnxt_en: Fix coredump logic to free allocated buffer Michael Chan
2025-04-28 22:59 ` [PATCH net 7/8] bnxt_en: Fix out-of-bound memcpy() during ethtool -w Michael Chan
2025-04-28 22:59 ` [PATCH net 8/8] bnxt_en: Fix ethtool -d byte order for 32-bit values Michael Chan
2025-05-01 13:57 ` [PATCH net 0/8] bnxt_en: Misc. 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=20250428225903.1867675-2-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=shravya.k-n@broadcom.com \
--cc=somnath.kotur@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).