Skip to content

Commit 4be2b49

Browse files
Stanislaw Gruszkadavem330
authored andcommitted
myri10ge: fix sleeping with bh disabled
napi_disable() can not be called with bh disabled, move locking just around myri10ge_ss_lock_napi() . Patches fixes following bug: [ 114.278378] BUG: sleeping function called from invalid context at net/core/dev.c:4383 <snip> [ 114.313712] Call Trace: [ 114.314943] [<ffffffff817010ce>] dump_stack+0x19/0x1b [ 114.317673] [<ffffffff810ce7f3>] __might_sleep+0x173/0x230 [ 114.320566] [<ffffffff815b3117>] napi_disable+0x27/0x90 [ 114.323254] [<ffffffffa01e437f>] myri10ge_close+0xbf/0x3f0 [myri10ge] Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Hyong-Youb Kim <hykim@myri.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent edb9a1b commit 4be2b49

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/net/ethernet/myricom/myri10ge/myri10ge.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,9 +2668,9 @@ static int myri10ge_close(struct net_device *dev)
26682668

26692669
del_timer_sync(&mgp->watchdog_timer);
26702670
mgp->running = MYRI10GE_ETH_STOPPING;
2671-
local_bh_disable(); /* myri10ge_ss_lock_napi needs bh disabled */
26722671
for (i = 0; i < mgp->num_slices; i++) {
26732672
napi_disable(&mgp->ss[i].napi);
2673+
local_bh_disable(); /* myri10ge_ss_lock_napi needs this */
26742674
/* Lock the slice to prevent the busy_poll handler from
26752675
* accessing it. Later when we bring the NIC up, myri10ge_open
26762676
* resets the slice including this lock.
@@ -2679,8 +2679,8 @@ static int myri10ge_close(struct net_device *dev)
26792679
pr_info("Slice %d locked\n", i);
26802680
mdelay(1);
26812681
}
2682+
local_bh_enable();
26822683
}
2683-
local_bh_enable();
26842684
netif_carrier_off(dev);
26852685

26862686
netif_tx_stop_all_queues(dev);

0 commit comments

Comments
 (0)