* myri10ge: fix sleeping with bh disabled
@ 2016-04-25 8:59 Stanislaw Gruszka
2016-04-26 2:22 ` Hyong-Youb Kim
2016-04-28 18:21 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Stanislaw Gruszka @ 2016-04-25 8:59 UTC (permalink / raw)
To: netdev; +Cc: Hyong-Youb Kim
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>
---
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 270c9ee..6d1a956 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -2668,9 +2668,9 @@ static int myri10ge_close(struct net_device *dev)
del_timer_sync(&mgp->watchdog_timer);
mgp->running = MYRI10GE_ETH_STOPPING;
- local_bh_disable(); /* myri10ge_ss_lock_napi needs bh disabled */
for (i = 0; i < mgp->num_slices; i++) {
napi_disable(&mgp->ss[i].napi);
+ local_bh_disable(); /* myri10ge_ss_lock_napi needs this */
/* Lock the slice to prevent the busy_poll handler from
* accessing it. Later when we bring the NIC up, myri10ge_open
* resets the slice including this lock.
@@ -2679,8 +2679,8 @@ static int myri10ge_close(struct net_device *dev)
pr_info("Slice %d locked\n", i);
mdelay(1);
}
+ local_bh_enable();
}
- local_bh_enable();
netif_carrier_off(dev);
netif_tx_stop_all_queues(dev);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: myri10ge: fix sleeping with bh disabled
2016-04-25 8:59 myri10ge: fix sleeping with bh disabled Stanislaw Gruszka
@ 2016-04-26 2:22 ` Hyong-Youb Kim
2016-04-28 18:21 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Hyong-Youb Kim @ 2016-04-26 2:22 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: netdev
On Mon, Apr 25, 2016 at 10:59:19AM +0200, Stanislaw Gruszka wrote:
> napi_disable() can not be called with bh disabled, move locking just
> around myri10ge_ss_lock_napi() .
Acked-by: Hyong-Youb Kim <hykim@myri.com>
Thanks.
>
> 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>
> ---
> diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> index 270c9ee..6d1a956 100644
> --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> @@ -2668,9 +2668,9 @@ static int myri10ge_close(struct net_device *dev)
>
> del_timer_sync(&mgp->watchdog_timer);
> mgp->running = MYRI10GE_ETH_STOPPING;
> - local_bh_disable(); /* myri10ge_ss_lock_napi needs bh disabled */
> for (i = 0; i < mgp->num_slices; i++) {
> napi_disable(&mgp->ss[i].napi);
> + local_bh_disable(); /* myri10ge_ss_lock_napi needs this */
> /* Lock the slice to prevent the busy_poll handler from
> * accessing it. Later when we bring the NIC up, myri10ge_open
> * resets the slice including this lock.
> @@ -2679,8 +2679,8 @@ static int myri10ge_close(struct net_device *dev)
> pr_info("Slice %d locked\n", i);
> mdelay(1);
> }
> + local_bh_enable();
> }
> - local_bh_enable();
> netif_carrier_off(dev);
>
> netif_tx_stop_all_queues(dev);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: myri10ge: fix sleeping with bh disabled
2016-04-25 8:59 myri10ge: fix sleeping with bh disabled Stanislaw Gruszka
2016-04-26 2:22 ` Hyong-Youb Kim
@ 2016-04-28 18:21 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-04-28 18:21 UTC (permalink / raw)
To: sgruszka; +Cc: netdev, hykim
From: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Mon, 25 Apr 2016 10:59:19 +0200
> 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>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-28 18:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-25 8:59 myri10ge: fix sleeping with bh disabled Stanislaw Gruszka
2016-04-26 2:22 ` Hyong-Youb Kim
2016-04-28 18:21 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).