The patch titled atmel_serial: Avoid stopping pdc during transmission has been added to the -mm tree. Its filename is atmel_serial-avoid-stopping-pdc-during-transmission.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: atmel_serial: Avoid stopping pdc during transmission From: Michael Trimarchi <trimarchimichael@xxxxxxxx> I found a problem related to loosing data during pdc trasmission in the atmel_serial. For now this patch seems to work for me, but I think that is not the better solution. I do this test: - connect ttyS1 with ttyS2 using a loopback cable, send 30 byte of packet from one to the other and waiting for 30 byte. On the other side just read and echo the data received. Signed-off-by: michael <trimarchi@xxxxxxxxxxxxxxxx> Cc: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/serial/atmel_serial.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff -puN drivers/serial/atmel_serial.c~atmel_serial-avoid-stopping-pdc-during-transmission drivers/serial/atmel_serial.c --- a/drivers/serial/atmel_serial.c~atmel_serial-avoid-stopping-pdc-during-transmission +++ a/drivers/serial/atmel_serial.c @@ -96,6 +96,7 @@ /* PDC registers */ #define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR) +#define UART_GET_TCR(port) __raw_readl((port)->membase + ATMEL_PDC_TCR) #define UART_GET_PTSR(port) __raw_readl((port)->membase + ATMEL_PDC_PTSR) #define UART_PUT_RPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RPR) @@ -568,11 +569,16 @@ static void atmel_tx_dma(struct uart_por port->icount.tx += pdc->ofs; pdc->ofs = 0; - if (!uart_circ_empty(xmit)) { - /* more to transmit - setup next transfer */ + /* more to transmit - setup next transfer */ - /* disable PDC transmit */ - UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); + /* nothing left to transmit? */ + while (UART_GET_TCR(port)) + cpu_relax(); + + /* disable PDC transmit */ + UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); + + if (!uart_circ_empty(xmit)) { dma_sync_single_for_device(port->dev, pdc->dma_addr, pdc->dma_size, @@ -586,11 +592,6 @@ static void atmel_tx_dma(struct uart_por /* re-enable PDC transmit and interrupts */ UART_PUT_PTCR(port, ATMEL_PDC_TXTEN); UART_PUT_IER(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); - } else { - /* nothing left to transmit - disable the transmitter */ - - /* disable PDC transmit */ - UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); } if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) _ Patches currently in -mm which might be from trimarchimichael@xxxxxxxx are atmel_serial-avoid-stopping-pdc-during-transmission.patch jffs2-add-write-verify-on-dataflash.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html