Skip to content

Commit e44aabd

Browse files
marcusfolkessongregkh
authored andcommitted
serial: pxa: work around for errata raspberrypi#20
Errata E20: UART: Character Timeout interrupt remains set under certain software conditions. Implication: The software servicing the UART can be trapped in an infinite loop. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 7d4008e commit e44aabd

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎drivers/tty/serial/pxa.c‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ static inline void receive_chars(struct uart_pxa_port *up, int *status)
100100
int max_count = 256;
101101

102102
do {
103+
/* work around Errata #20 according to
104+
* Intel(R) PXA27x Processor Family
105+
* Specification Update (May 2005)
106+
*
107+
* Step 2
108+
* Disable the Reciever Time Out Interrupt via IER[RTOEI]
109+
*/
110+
up->ier &= ~UART_IER_RTOIE;
111+
serial_out(up, UART_IER, up->ier);
112+
103113
ch = serial_in(up, UART_RX);
104114
flag = TTY_NORMAL;
105115
up->port.icount.rx++;
@@ -156,6 +166,16 @@ static inline void receive_chars(struct uart_pxa_port *up, int *status)
156166
*status = serial_in(up, UART_LSR);
157167
} while ((*status & UART_LSR_DR) && (max_count-- > 0));
158168
tty_flip_buffer_push(tty);
169+
170+
/* work around Errata #20 according to
171+
* Intel(R) PXA27x Processor Family
172+
* Specification Update (May 2005)
173+
*
174+
* Step 6:
175+
* No more data in FIFO: Re-enable RTO interrupt via IER[RTOIE]
176+
*/
177+
up->ier |= UART_IER_RTOIE;
178+
serial_out(up, UART_IER, up->ier);
159179
}
160180

161181
static void transmit_chars(struct uart_pxa_port *up)

0 commit comments

Comments
 (0)