* [PATCH net v2] bnxt_en: Fix lockdep warning during rmmod
@ 2025-08-16 18:38 Michael Chan
2025-08-17 13:21 ` Vadim Fedorenko
2025-08-19 1:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Michael Chan @ 2025-08-16 18:38 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, kuba, pabeni, andrew+netdev, pavan.chebbi,
andrew.gospodarek, sdf
The commit under the Fixes tag added a netdev_assert_locked() in
bnxt_free_ntp_fltrs(). The lock should be held during normal run-time
but the assert will be triggered (see below) during bnxt_remove_one()
which should not need the lock. The netdev is already unregistered by
then. Fix it by calling netdev_assert_locked_or_invisible() which will
not assert if the netdev is unregistered.
WARNING: CPU: 5 PID: 2241 at ./include/net/netdev_lock.h:17 bnxt_free_ntp_fltrs+0xf8/0x100 [bnxt_en]
Modules linked in: rpcrdma rdma_cm iw_cm ib_cm configfs ib_core bnxt_en(-) bridge stp llc x86_pkg_temp_thermal xfs tg3 [last unloaded: bnxt_re]
CPU: 5 UID: 0 PID: 2241 Comm: rmmod Tainted: G S W 6.16.0 #2 PREEMPT(voluntary)
Tainted: [S]=CPU_OUT_OF_SPEC, [W]=WARN
Hardware name: Dell Inc. PowerEdge R730/072T6D, BIOS 2.4.3 01/17/2017
RIP: 0010:bnxt_free_ntp_fltrs+0xf8/0x100 [bnxt_en]
Code: 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 48 8b 47 60 be ff ff ff ff 48 8d b8 28 0c 00 00 e8 d0 cf 41 c3 85 c0 0f 85 2e ff ff ff <0f> 0b e9 27 ff ff ff 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffa92082387da0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff9e5b593d8000 RCX: 0000000000000001
RDX: 0000000000000001 RSI: ffffffff83dc9a70 RDI: ffffffff83e1a1cf
RBP: ffff9e5b593d8c80 R08: 0000000000000000 R09: ffffffff8373a2b3
R10: 000000008100009f R11: 0000000000000001 R12: 0000000000000001
R13: ffffffffc01c4478 R14: dead000000000122 R15: dead000000000100
FS: 00007f3a8a52c740(0000) GS:ffff9e631ad1c000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055bb289419c8 CR3: 000000011274e001 CR4: 00000000003706f0
Call Trace:
<TASK>
bnxt_remove_one+0x57/0x180 [bnxt_en]
pci_device_remove+0x39/0xc0
device_release_driver_internal+0xa5/0x130
driver_detach+0x42/0x90
bus_remove_driver+0x61/0xc0
pci_unregister_driver+0x38/0x90
bnxt_exit+0xc/0x7d0 [bnxt_en]
Fixes: 004b5008016a ("eth: bnxt: remove most dependencies on RTNL")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
v2: Use netdev_assert_locked_or_invisible()
v1: https://lore.kernel.org/netdev/20250815170823.4062508-1-michael.chan@broadcom.com/
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 2800a90fba1f..207a8bb36ae5 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -5332,7 +5332,7 @@ static void bnxt_free_ntp_fltrs(struct bnxt *bp, bool all)
{
int i;
- netdev_assert_locked(bp->dev);
+ netdev_assert_locked_or_invisible(bp->dev);
/* Under netdev instance lock and all our NAPIs have been disabled.
* It's safe to delete the hash table.
--
2.30.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] bnxt_en: Fix lockdep warning during rmmod
2025-08-16 18:38 [PATCH net v2] bnxt_en: Fix lockdep warning during rmmod Michael Chan
@ 2025-08-17 13:21 ` Vadim Fedorenko
2025-08-19 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Vadim Fedorenko @ 2025-08-17 13:21 UTC (permalink / raw)
To: Michael Chan, davem
Cc: netdev, edumazet, kuba, pabeni, andrew+netdev, pavan.chebbi,
andrew.gospodarek, sdf
On 16.08.2025 19:38, Michael Chan wrote:
> The commit under the Fixes tag added a netdev_assert_locked() in
> bnxt_free_ntp_fltrs(). The lock should be held during normal run-time
> but the assert will be triggered (see below) during bnxt_remove_one()
> which should not need the lock. The netdev is already unregistered by
> then. Fix it by calling netdev_assert_locked_or_invisible() which will
> not assert if the netdev is unregistered.
>
> WARNING: CPU: 5 PID: 2241 at ./include/net/netdev_lock.h:17 bnxt_free_ntp_fltrs+0xf8/0x100 [bnxt_en]
> Modules linked in: rpcrdma rdma_cm iw_cm ib_cm configfs ib_core bnxt_en(-) bridge stp llc x86_pkg_temp_thermal xfs tg3 [last unloaded: bnxt_re]
> CPU: 5 UID: 0 PID: 2241 Comm: rmmod Tainted: G S W 6.16.0 #2 PREEMPT(voluntary)
> Tainted: [S]=CPU_OUT_OF_SPEC, [W]=WARN
> Hardware name: Dell Inc. PowerEdge R730/072T6D, BIOS 2.4.3 01/17/2017
> RIP: 0010:bnxt_free_ntp_fltrs+0xf8/0x100 [bnxt_en]
> Code: 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 48 8b 47 60 be ff ff ff ff 48 8d b8 28 0c 00 00 e8 d0 cf 41 c3 85 c0 0f 85 2e ff ff ff <0f> 0b e9 27 ff ff ff 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
> RSP: 0018:ffffa92082387da0 EFLAGS: 00010246
> RAX: 0000000000000000 RBX: ffff9e5b593d8000 RCX: 0000000000000001
> RDX: 0000000000000001 RSI: ffffffff83dc9a70 RDI: ffffffff83e1a1cf
> RBP: ffff9e5b593d8c80 R08: 0000000000000000 R09: ffffffff8373a2b3
> R10: 000000008100009f R11: 0000000000000001 R12: 0000000000000001
> R13: ffffffffc01c4478 R14: dead000000000122 R15: dead000000000100
> FS: 00007f3a8a52c740(0000) GS:ffff9e631ad1c000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 000055bb289419c8 CR3: 000000011274e001 CR4: 00000000003706f0
> Call Trace:
> <TASK>
> bnxt_remove_one+0x57/0x180 [bnxt_en]
> pci_device_remove+0x39/0xc0
> device_release_driver_internal+0xa5/0x130
> driver_detach+0x42/0x90
> bus_remove_driver+0x61/0xc0
> pci_unregister_driver+0x38/0x90
> bnxt_exit+0xc/0x7d0 [bnxt_en]
>
> Fixes: 004b5008016a ("eth: bnxt: remove most dependencies on RTNL")
> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
> Signed-off-by: Michael Chan <michael.chan@broadcom.com>
> ---
> v2: Use netdev_assert_locked_or_invisible()
>
> v1: https://lore.kernel.org/netdev/20250815170823.4062508-1-michael.chan@broadcom.com/
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 2800a90fba1f..207a8bb36ae5 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -5332,7 +5332,7 @@ static void bnxt_free_ntp_fltrs(struct bnxt *bp, bool all)
> {
> int i;
>
> - netdev_assert_locked(bp->dev);
> + netdev_assert_locked_or_invisible(bp->dev);
>
> /* Under netdev instance lock and all our NAPIs have been disabled.
> * It's safe to delete the hash table.
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] bnxt_en: Fix lockdep warning during rmmod
2025-08-16 18:38 [PATCH net v2] bnxt_en: Fix lockdep warning during rmmod Michael Chan
2025-08-17 13:21 ` Vadim Fedorenko
@ 2025-08-19 1:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-19 1:00 UTC (permalink / raw)
To: Michael Chan
Cc: davem, netdev, edumazet, kuba, pabeni, andrew+netdev,
pavan.chebbi, andrew.gospodarek, sdf
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 16 Aug 2025 11:38:50 -0700 you wrote:
> The commit under the Fixes tag added a netdev_assert_locked() in
> bnxt_free_ntp_fltrs(). The lock should be held during normal run-time
> but the assert will be triggered (see below) during bnxt_remove_one()
> which should not need the lock. The netdev is already unregistered by
> then. Fix it by calling netdev_assert_locked_or_invisible() which will
> not assert if the netdev is unregistered.
>
> [...]
Here is the summary with links:
- [net,v2] bnxt_en: Fix lockdep warning during rmmod
https://git.kernel.org/netdev/net/c/4611d88a37cf
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-19 0:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-16 18:38 [PATCH net v2] bnxt_en: Fix lockdep warning during rmmod Michael Chan
2025-08-17 13:21 ` Vadim Fedorenko
2025-08-19 1:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox