e1000e: perform 10/100 adaptive IFS only on parts that support it
[safe/jmp/linux-2.6] / drivers / net / ppp_synctty.c
index 1b3f75f..3a13cec 100644 (file)
@@ -182,15 +182,13 @@ static DEFINE_RWLOCK(disc_data_lock);
 
 static struct syncppp *sp_get(struct tty_struct *tty)
 {
-       unsigned long flags;
        struct syncppp *ap;
 
-       read_lock_irqsave(&disc_data_lock, flags);
+       read_lock(&disc_data_lock);
        ap = tty->disc_data;
        if (ap != NULL)
                atomic_inc(&ap->refcnt);
-       read_unlock_irqrestore(&disc_data_lock, flags);
-
+       read_unlock(&disc_data_lock);
        return ap;
 }
 
@@ -264,13 +262,12 @@ ppp_sync_open(struct tty_struct *tty)
 static void
 ppp_sync_close(struct tty_struct *tty)
 {
-       unsigned long flags;
        struct syncppp *ap;
 
-       write_lock_irqsave(&disc_data_lock, flags);
+       write_lock_irq(&disc_data_lock);
        ap = tty->disc_data;
        tty->disc_data = NULL;
-       write_unlock_irqrestore(&disc_data_lock, flags);
+       write_unlock_irq(&disc_data_lock);
        if (!ap)
                return;
 
@@ -381,10 +378,7 @@ ppp_sync_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
        return 0;
 }
 
-/*
- * This can now be called from hard interrupt level as well
- * as soft interrupt level or mainline.
- */
+/* May sleep, don't call from interrupt level or with interrupts disabled */
 static void
 ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
                  char *cflags, int count)
@@ -400,6 +394,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
        if (!skb_queue_empty(&ap->rqueue))
                tasklet_schedule(&ap->tsk);
        sp_put(ap);
+       tty_unthrottle(tty);
 }
 
 static void
@@ -667,8 +662,8 @@ ppp_sync_push(struct syncppp *ap)
                }
                /* haven't made any progress */
                spin_unlock_bh(&ap->xmit_lock);
-               if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags)
-                     || (!tty_stuffed && ap->tpkt)))
+               if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) ||
+                     (!tty_stuffed && ap->tpkt)))
                        break;
                if (!spin_trylock_bh(&ap->xmit_lock))
                        break;