From: Jacob Keller Date: Sat, 21 Sep 2013 05:05:39 +0000 (+0000) Subject: net: add might_sleep() call to napi_disable X-Git-Tag: Ubuntu-5.2.0-15.16~14566^2~100^2~9 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=80c33dd;p=mirror_ubuntu-eoan-kernel.git net: add might_sleep() call to napi_disable napi_disable uses an msleep() call to wait for outstanding napi work to be finished after setting the disable bit. It does not always sleep incase there was no outstanding work. This resulted in a rare bug in ixgbe_down operation where a napi_disable call took place inside of a local_bh_disable()d context. In order to enable easier detection of future sleep while atomic BUGs, this patch adds a might_sleep() call, so that every use of napi_disable during atomic context will be visible. Signed-off-by: Jacob Keller Cc: Eliezer Tamir Cc: Alexander Duyck Cc: Hyong-Youb Kim Cc: Amir Vadai Cc: Dmitry Kravkov Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher --- diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 27f62f746621..cb1d918ecdf1 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -483,6 +483,7 @@ void napi_hash_del(struct napi_struct *napi); */ static inline void napi_disable(struct napi_struct *n) { + might_sleep(); set_bit(NAPI_STATE_DISABLE, &n->state); while (test_and_set_bit(NAPI_STATE_SCHED, &n->state)) msleep(1);