Skip to content

Commit

Permalink
Serial: Do not read IIR in serial8250_start_tx when UART_BUG_TXEN
Browse files Browse the repository at this point in the history
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: Ian Jackson <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Reviewed-by: Jiri Kosina <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ijackson-citrix authored and gregkh committed Dec 11, 2009
1 parent 7e11a0f commit 68cb4f8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,14 +1339,12 @@ static void serial8250_start_tx(struct uart_port *port)
serial_out(up, UART_IER, up->ier);

if (up->bugs & UART_BUG_TXEN) {
unsigned char lsr, iir;
unsigned char lsr;
lsr = serial_in(up, UART_LSR);
up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
iir = serial_in(up, UART_IIR) & 0x0f;
if ((up->port.type == PORT_RM9000) ?
(lsr & UART_LSR_THRE &&
(iir == UART_IIR_NO_INT || iir == UART_IIR_THRI)) :
(lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT))
(lsr & UART_LSR_THRE) :
(lsr & UART_LSR_TEMT))
transmit_chars(up);
}
}
Expand Down

0 comments on commit 68cb4f8

Please sign in to comment.