[PATCH] e1000: Added interrupt auto mask support
[safe/jmp/linux-2.6] / drivers / net / 8139too.c
index bcea9d4..adfba44 100644 (file)
@@ -505,7 +505,7 @@ enum chip_flags {
 #define HW_REVID_MASK  HW_REVID(1, 1, 1, 1, 1, 1, 1)
 
 /* directly indexed by chip_t, above */
-const static struct {
+static const struct {
        const char *name;
        u32 version; /* from RTL8139C/RTL8139D docs */
        u32 flags;
@@ -1598,13 +1598,19 @@ static void rtl8139_thread (void *_data)
 {
        struct net_device *dev = _data;
        struct rtl8139_private *tp = netdev_priv(dev);
+       unsigned long thr_delay;
 
-       if (rtnl_lock_interruptible() == 0) {
+       if (rtnl_shlock_nowait() == 0) {
                rtl8139_thread_iter (dev, tp, tp->mmio_addr);
                rtnl_unlock ();
+
+               thr_delay = next_tick;
+       } else {
+               /* unlikely race.  mitigate with fast poll. */
+               thr_delay = HZ / 2;
        }
 
-       schedule_delayed_work(&tp->thread, next_tick);
+       schedule_delayed_work(&tp->thread, thr_delay);
 }
 
 static void rtl8139_start_thread(struct rtl8139_private *tp)