diff options
-rw-r--r-- | drivers/net/e1000/e1000_osdep.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h index 970c656a517c..2efa3b1b64dc 100644 --- a/drivers/net/e1000/e1000_osdep.h +++ b/drivers/net/e1000/e1000_osdep.h | |||
@@ -42,7 +42,12 @@ | |||
42 | #include <linux/sched.h> | 42 | #include <linux/sched.h> |
43 | 43 | ||
44 | #ifndef msec_delay | 44 | #ifndef msec_delay |
45 | #define msec_delay(x) msleep(x) | 45 | #define msec_delay(x) do { if(in_interrupt()) { \ |
46 | /* Don't mdelay in interrupt context! */ \ | ||
47 | BUG(); \ | ||
48 | } else { \ | ||
49 | msleep(x); \ | ||
50 | } } while(0) | ||
46 | 51 | ||
47 | /* Some workarounds require millisecond delays and are run during interrupt | 52 | /* Some workarounds require millisecond delays and are run during interrupt |
48 | * context. Most notably, when establishing link, the phy may need tweaking | 53 | * context. Most notably, when establishing link, the phy may need tweaking |