TTY: use tty_wait_until_sent_from_close in other drivers
authorJiri Slaby <jslaby@suse.cz>
Thu, 25 Aug 2011 13:12:08 +0000 (15:12 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 25 Aug 2011 16:00:42 +0000 (09:00 -0700)
Let's use the newly added helper to avoid stalls in drivers which are
not yet ported to tty_port helpers.

Those which are broken (call tty_wait_until_sent with irqs disabled)
are left untouched. They are in a deeper trouble than we are trying to
solve here. This includes amiserial, 68328serial, 68360serial and
crisv10.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/isdn/i4l/isdn_tty.c
drivers/tty/hvc/hvc_console.c
drivers/tty/hvc/hvcs.c
drivers/tty/serial/serial_core.c
net/irda/ircomm/ircomm_tty.c

index d8504279e502faba47beeee40dcd4b937b0370cf..e5546cb3ac691666048bae0678af98175a26a376 100644 (file)
@@ -1693,7 +1693,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
         * line status register.
         */
        if (info->flags & ISDN_ASYNC_INITIALIZED) {
-               tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */
+               tty_wait_until_sent_from_close(tty, 3000);      /* 30 seconds timeout */
                /*
                 * Before we drop DTR, make sure the UART transmitter
                 * has completely drained; this is especially
index e1aaf4f309b3c2730dd435642bfa68cc4c6ad85b..b6b2d18fa38dc9827f47a297cfeb6d013f6b21f7 100644 (file)
@@ -388,7 +388,7 @@ static void hvc_close(struct tty_struct *tty, struct file * filp)
                 * there is no buffered data otherwise sleeps on a wait queue
                 * waking periodically to check chars_in_buffer().
                 */
-               tty_wait_until_sent(tty, HVC_CLOSE_WAIT);
+               tty_wait_until_sent_from_close(tty, HVC_CLOSE_WAIT);
        } else {
                if (hp->count < 0)
                        printk(KERN_ERR "hvc_close %X: oops, count is %d\n",
index 4c8b66546930bc11dbc42ff39cc3b71bd533b39a..e523773a548061c8f4a782f665b27a83c1ef71ac 100644 (file)
@@ -1237,7 +1237,7 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp)
                irq = hvcsd->vdev->irq;
                spin_unlock_irqrestore(&hvcsd->lock, flags);
 
-               tty_wait_until_sent(tty, HVCS_CLOSE_WAIT);
+               tty_wait_until_sent_from_close(tty, HVCS_CLOSE_WAIT);
 
                /*
                 * This line is important because it tells hvcs_open that this
index 0464360781fe556b7e2b213912bf3530f2bcef3f..1d3780cc3b706eb4f72ed8763d696f2c850e6b7a 100644 (file)
@@ -1292,7 +1292,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
        spin_unlock_irqrestore(&port->lock, flags);
 
        if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-               tty_wait_until_sent(tty, msecs_to_jiffies(port->closing_wait));
+               tty_wait_until_sent_from_close(tty,
+                               msecs_to_jiffies(port->closing_wait));
 
        /*
         * At this point, we stop accepting input.  To do this, we
index b3cc8b3989a9cf17d032150d201e8ab90f3bd2c7..253695d43fd9db61d674646f36fdb1cc796e521d 100644 (file)
@@ -551,7 +551,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
         */
        tty->closing = 1;
        if (self->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-               tty_wait_until_sent(tty, self->closing_wait);
+               tty_wait_until_sent_from_close(tty, self->closing_wait);
 
        ircomm_tty_shutdown(self);