Skip to content

Commit e4546c6

Browse files
TaeheeYookuba-moo
authored andcommitted
eth: bnxt: fix deadlock in the mgmt_ops
When queue is being reset, callbacks of mgmt_ops are called by netdev_nl_bind_rx_doit(). The netdev_nl_bind_rx_doit() first acquires netdev_lock() and then calls callbacks. So, mgmt_ops callbacks should not acquire netdev_lock() internaly. The bnxt_queue_{start | stop}() calls napi_{enable | disable}() but they internally acquire netdev_lock(). So, deadlock occurs. To avoid deadlock, napi_{enable | disable}_locked() should be used instead. Signed-off-by: Taehee Yoo <ap420073@gmail.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Michael Chan <michael.chan@broadcom.com> Fixes: cae03e5 ("net: hold netdev instance lock during queue operations") Link: https://patch.msgid.link/20250402133123.840173-1-ap420073@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e5ddf19 commit e4546c6

File tree

1 file changed

+3
-3
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15909,7 +15909,7 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1590915909
goto err_reset;
1591015910
}
1591115911

15912-
napi_enable(&bnapi->napi);
15912+
napi_enable_locked(&bnapi->napi);
1591315913
bnxt_db_nq_arm(bp, &cpr->cp_db, cpr->cp_raw_cons);
1591415914

1591515915
for (i = 0; i < bp->nr_vnics; i++) {
@@ -15931,7 +15931,7 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1593115931
err_reset:
1593215932
netdev_err(bp->dev, "Unexpected HWRM error during queue start rc: %d\n",
1593315933
rc);
15934-
napi_enable(&bnapi->napi);
15934+
napi_enable_locked(&bnapi->napi);
1593515935
bnxt_db_nq_arm(bp, &cpr->cp_db, cpr->cp_raw_cons);
1593615936
bnxt_reset_task(bp, true);
1593715937
return rc;
@@ -15971,7 +15971,7 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx)
1597115971
* completion is handled in NAPI to guarantee no more DMA on that ring
1597215972
* after seeing the completion.
1597315973
*/
15974-
napi_disable(&bnapi->napi);
15974+
napi_disable_locked(&bnapi->napi);
1597515975

1597615976
if (bp->tph_mode) {
1597715977
bnxt_hwrm_cp_ring_free(bp, rxr->rx_cpr);

0 commit comments

Comments
 (0)