]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/bnx2x/bnx2x_ethtool.c
bnx2x: Disable local BHes to prevent a dead-lock situation
[net-next-2.6.git] / drivers / net / bnx2x / bnx2x_ethtool.c
index d02ffbdc9f0ef551d4f17ba384f2d32a683c7ab2..03012787de2f0750790c48a71709c5fa11737af5 100644 (file)
@@ -1499,8 +1499,15 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up)
         * updates that have been performed while interrupts were
         * disabled.
         */
-       if (bp->common.int_block == INT_BLOCK_IGU)
+       if (bp->common.int_block == INT_BLOCK_IGU) {
+               /* Disable local BHes to prevent a dead-lock situation between
+                * sch_direct_xmit() and bnx2x_run_loopback() (calling
+                * bnx2x_tx_int()), as both are taking netif_tx_lock().
+                */
+               local_bh_disable();
                bnx2x_tx_int(fp_tx);
+               local_bh_enable();
+       }
 
        rx_idx = le16_to_cpu(*fp_rx->rx_cons_sb);
        if (rx_idx != rx_start_idx + num_pkts)