mxser: remove wait for sent from mxser_close_port
authorJiri Slaby <jslaby@suse.cz>
Thu, 18 Nov 2021 07:31:07 +0000 (08:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 17:33:21 +0000 (18:33 +0100)
mxser_close() behaves like this:
  -> tty_port_close_start()
    -> tty_wait_until_sent()
      -> mxser_wait_until_sent()
  -> mxser_close_port
    -> wait for TEMT

So it is already waited for TEMT through mxser_wait_until_sent() and
there is another round of waiting in mxser_close_port(). The latter one
is superfluous as nothing could be filled into the output FIFO. Remove
the call.

This helps unification among drivers (so that all behave the same) and
future use of tty_port_close().

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20211118073125.12283-2-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/mxser.c

index 93a95a135a71ae2049c59f8fc754eead2831b97b..f9615245a60aefdc5878bf3a4219d56c31af9eba 100644 (file)
@@ -878,7 +878,6 @@ static void mxser_flush_buffer(struct tty_struct *tty)
 static void mxser_close_port(struct tty_port *port)
 {
        struct mxser_port *info = container_of(port, struct mxser_port, port);
-       unsigned long timeout;
        /*
         * At this point we stop accepting input.  To do this, we
         * disable the receive line status interrupts, and tell the
@@ -890,17 +889,6 @@ static void mxser_close_port(struct tty_port *port)
                info->IER &= ~MOXA_MUST_RECV_ISR;
 
        outb(info->IER, info->ioaddr + UART_IER);
-       /*
-        * Before we drop DTR, make sure the UART transmitter
-        * has completely drained; this is especially
-        * important if there is a transmit FIFO!
-        */
-       timeout = jiffies + HZ;
-       while (!(inb(info->ioaddr + UART_LSR) & UART_LSR_TEMT)) {
-               schedule_timeout_interruptible(5);
-               if (time_after(jiffies, timeout))
-                       break;
-       }
 }
 
 /*