Skip to content

Commit b0483e7

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: serial: 8250: add serial transmitter fully empty test
2 parents 1868821 + bca4761 commit b0483e7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/serial/8250.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */
8383

8484
#define PASS_LIMIT 256
8585

86+
#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
87+
88+
8689
/*
8790
* We default to IRQ0 for the "no irq" hack. Some
8891
* machine types want others as well - they're free
@@ -1792,7 +1795,7 @@ static unsigned int serial8250_tx_empty(struct uart_port *port)
17921795
up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
17931796
spin_unlock_irqrestore(&up->port.lock, flags);
17941797

1795-
return lsr & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
1798+
return (lsr & BOTH_EMPTY) == BOTH_EMPTY ? TIOCSER_TEMT : 0;
17961799
}
17971800

17981801
static unsigned int serial8250_get_mctrl(struct uart_port *port)
@@ -1850,8 +1853,6 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state)
18501853
spin_unlock_irqrestore(&up->port.lock, flags);
18511854
}
18521855

1853-
#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
1854-
18551856
/*
18561857
* Wait for transmitter & holding register to empty
18571858
*/

0 commit comments

Comments
 (0)