From e25ed43b4b603c1f7727bfede684b165dc5cd18c Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Thu, 18 Nov 2021 08:31:07 +0100 Subject: [PATCH] mxser: remove wait for sent from mxser_close_port 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 Link: https://lore.kernel.org/r/20211118073125.12283-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman --- drivers/tty/mxser.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 93a95a135a71a..f9615245a60ae 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -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; - } } /* -- 2.30.2