Reduce the trasmitting window size to avoid blocking of tasklet because it must handle the receive phase too. Signed-off-by: michael --- drivers/serial/atmel_serial.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 9f58eb3..511a0cc 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c @@ -123,6 +123,7 @@ struct atmel_uart_char { }; #define ATMEL_SERIAL_RINGSIZE 1024 +#define ATMEL_SERIAL_TXSIZE 32 /* * We wrap our port structure around the generic uart_port. @@ -426,6 +427,7 @@ static void atmel_rx_chars(struct uart_port *port) static void atmel_tx_chars(struct uart_port *port) { struct circ_buf *xmit = &port->info->xmit; + int count = 0; if (port->x_char && UART_GET_CSR(port) & ATMEL_US_TXRDY) { UART_PUT_CHAR(port, port->x_char); @@ -435,10 +437,12 @@ static void atmel_tx_chars(struct uart_port *port) if (uart_circ_empty(xmit) || uart_tx_stopped(port)) return; - while (UART_GET_CSR(port) & ATMEL_US_TXRDY) { + while (UART_GET_CSR(port) & ATMEL_US_TXRDY && + count < ATMEL_SERIAL_TXSIZE) { UART_PUT_CHAR(port, xmit->buf[xmit->tail]); xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; + count++; if (uart_circ_empty(xmit)) break; } -- 1.5.2.1.174.gcd03-dirty