From: Michael Trimarchi I try to do more tests to the serial driver and I adjust my patch, because it has problem when the pending dma transfer contain a lot of bytes ( I can't wait a lot ). When we have pending trasmission and we are in the tasklet, we wait for long time (9600 bps and and xmit size equal to a XMIT_SIZE for example ) but the wakeup event of the tasklet happen for a "receive event" so we first receive the bytes in the pdc buffer. The driver wiil receive an interrupt later at the end of pdc transmission. The same things happen when we are in interrupt mode. So I suppose that with the latest patch we have: - tx_dma & rx_dma works on heavy load, slow rate and high rate - interrupt tx & rx_dma does't work on heavy load because it spend a lot of time for trasmission - interrupt tx & interrupt tx does't work on heavy load Possible solutions when using interrupt tx can be: - increase the buffering ( I don't like it ) - avoid long transmit phase Cc: Haavard Skinnemoen Signed-off-by: Andrew Morton --- drivers/serial/atmel_serial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff -puN drivers/serial/atmel_serial.c~atmel_serial-avoid-stopping-pdc-during-transmission-update drivers/serial/atmel_serial.c --- a/drivers/serial/atmel_serial.c~atmel_serial-avoid-stopping-pdc-during-transmission-update +++ a/drivers/serial/atmel_serial.c @@ -563,6 +563,10 @@ static void atmel_tx_dma(struct uart_por struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx; int count; + /* nothing left to transmit? */ + if (UART_GET_TCR(port)) + return; + xmit->tail += pdc->ofs; xmit->tail &= UART_XMIT_SIZE - 1; @@ -571,10 +575,6 @@ static void atmel_tx_dma(struct uart_por /* more to transmit - setup next transfer */ - /* nothing left to transmit? */ - while (UART_GET_TCR(port)) - cpu_relax(); - /* disable PDC transmit */ UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); _