diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2013-09-21 05:05:39 +0000 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-10-29 02:40:21 -0700 |
commit | 80c33ddd31d0e801953e02b7b003f395c1920e4e (patch) | |
tree | 4f80ae0bdf146705c932aa039fcb48d47626478e /include | |
parent | e6cd988c27bb5918630db67b3526c9e78e786818 (diff) | |
download | linux-stable-80c33ddd31d0e801953e02b7b003f395c1920e4e.tar.gz linux-stable-80c33ddd31d0e801953e02b7b003f395c1920e4e.tar.bz2 linux-stable-80c33ddd31d0e801953e02b7b003f395c1920e4e.zip |
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 <jacob.e.keller@intel.com>
Cc: Eliezer Tamir <eliezer.tamir@linux.intel.com>
Cc: Alexander Duyck <alexander.duyck@intel.com>
Cc: Hyong-Youb Kim <hykim@myri.com>
Cc: Amir Vadai <amirv@mellanox.com>
Cc: Dmitry Kravkov <dmitry@broadcom.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 1 |
1 files changed, 1 insertions, 0 deletions
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); |