[PATCH] e1000: Fix msec-delay definition to use msleep
authorMalli Chilakala <mallikarjuna.chilakala@intel.com>
Fri, 29 Apr 2005 02:38:43 +0000 (19:38 -0700)
committerJeff Garzik <jgarzik@pobox.com>
Fri, 13 May 2005 00:48:52 +0000 (20:48 -0400)
Fix msec-delay definition in e1000_osdep.h to use msleep

Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: Ganesh Venkatesan <ganesh.venkatesan@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
diff -up net-drivers-2.6/drivers/net/e1000/e1000_osdep.h net-drivers-2.6/drivers/net/e1000.new/e1000_osdep.h

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