Commit 68cb4f8e authored by Ian Jackson's avatar Ian Jackson Committed by Greg Kroah-Hartman

Serial: Do not read IIR in serial8250_start_tx when UART_BUG_TXEN

Do not read IIR in serial8250_start_tx when UART_BUG_TXEN

Reading the IIR clears some oustanding interrupts so it is not safe.
Instead, simply transmit immediately if the buffer is empty without
regard to IIR.
Signed-off-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarJiri Kosina <jkosina@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7e11a0fb
...@@ -1339,14 +1339,12 @@ static void serial8250_start_tx(struct uart_port *port) ...@@ -1339,14 +1339,12 @@ static void serial8250_start_tx(struct uart_port *port)
serial_out(up, UART_IER, up->ier); serial_out(up, UART_IER, up->ier);
if (up->bugs & UART_BUG_TXEN) { if (up->bugs & UART_BUG_TXEN) {
unsigned char lsr, iir; unsigned char lsr;
lsr = serial_in(up, UART_LSR); lsr = serial_in(up, UART_LSR);
up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
iir = serial_in(up, UART_IIR) & 0x0f;
if ((up->port.type == PORT_RM9000) ? if ((up->port.type == PORT_RM9000) ?
(lsr & UART_LSR_THRE && (lsr & UART_LSR_THRE) :
(iir == UART_IIR_NO_INT || iir == UART_IIR_THRI)) : (lsr & UART_LSR_TEMT))
(lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT))
transmit_chars(up); transmit_chars(up);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment