[PATCH] e1000: Fix msec-delay definition to use msleep
[linux-3.10.git] / drivers / net / e1000 / e1000_osdep.h
index 970c656a517c196be5eb60258b874224227e3f8c..2efa3b1b64dc3b4261d326bf9e5b5caeb302769b 100644 (file)
 #include <linux/sched.h>
 
 #ifndef msec_delay
-#define msec_delay(x) msleep(x)
+#define msec_delay(x)  do { if(in_interrupt()) { \
+                               /* Don't mdelay in interrupt context! */ \
+                               BUG(); \
+                       } else { \
+                               msleep(x); \
+                       } } while(0)
 
 /* Some workarounds require millisecond delays and are run during interrupt
  * context.  Most notably, when establishing link, the phy may need tweaking