Patch "bnxt: don't enable NAPI until rings are ready" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    bnxt: don't enable NAPI until rings are ready

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bnxt-don-t-enable-napi-until-rings-are-ready.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0a3018223231a09b7078f993e11992de831c5a77
Author: Jakub Kicinski <kuba@xxxxxxxxxx>
Date:   Wed Aug 26 12:40:07 2020 -0700

    bnxt: don't enable NAPI until rings are ready
    
    [ Upstream commit 96ecdcc992eb7f468b2cf829b0f5408a1fad4668 ]
    
    Netpoll can try to poll napi as soon as napi_enable() is called.
    It crashes trying to access a doorbell which is still NULL:
    
     BUG: kernel NULL pointer dereference, address: 0000000000000000
     CPU: 59 PID: 6039 Comm: ethtool Kdump: loaded Tainted: G S                5.9.0-rc1-00469-g5fd99b5d9950-dirty #26
     RIP: 0010:bnxt_poll+0x121/0x1c0
     Code: c4 20 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 41 8b 86 a0 01 00 00 41 23 85 18 01 00 00 49 8b 96 a8 01 00 00 0d 00 00 00 24 <89> 02
    41 f6 45 77 02 74 cb 49 8b ae d8 01 00 00 31 c0 c7 44 24 1a
      netpoll_poll_dev+0xbd/0x1a0
      __netpoll_send_skb+0x1b2/0x210
      netpoll_send_udp+0x2c9/0x406
      write_ext_msg+0x1d7/0x1f0
      console_unlock+0x23c/0x520
      vprintk_emit+0xe0/0x1d0
      printk+0x58/0x6f
      x86_vector_activate.cold+0xf/0x46
      __irq_domain_activate_irq+0x50/0x80
      __irq_domain_activate_irq+0x32/0x80
      __irq_domain_activate_irq+0x32/0x80
      irq_domain_activate_irq+0x25/0x40
      __setup_irq+0x2d2/0x700
      request_threaded_irq+0xfb/0x160
      __bnxt_open_nic+0x3b1/0x750
      bnxt_open_nic+0x19/0x30
      ethtool_set_channels+0x1ac/0x220
      dev_ethtool+0x11ba/0x2240
      dev_ioctl+0x1cf/0x390
      sock_do_ioctl+0x95/0x130
    
    Reported-by: Rob Sherwood <rsher@xxxxxx>
    Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Reviewed-by: Michael Chan <michael.chan@xxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 089d7b9cc409d..4030020f92be5 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -9132,15 +9132,15 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
 		}
 	}
 
-	bnxt_enable_napi(bp);
-	bnxt_debug_dev_init(bp);
-
 	rc = bnxt_init_nic(bp, irq_re_init);
 	if (rc) {
 		netdev_err(bp->dev, "bnxt_init_nic err: %x\n", rc);
-		goto open_err;
+		goto open_err_irq;
 	}
 
+	bnxt_enable_napi(bp);
+	bnxt_debug_dev_init(bp);
+
 	if (link_re_init) {
 		mutex_lock(&bp->link_lock);
 		rc = bnxt_update_phy_setting(bp);
@@ -9171,10 +9171,6 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
 		bnxt_vf_reps_open(bp);
 	return 0;
 
-open_err:
-	bnxt_debug_dev_exit(bp);
-	bnxt_disable_napi(bp);
-
 open_err_irq:
 	bnxt_del_napi(bp);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux