Commit 9afd561a authored by Haavard Skinnemoen's avatar Haavard Skinnemoen Committed by Linus Torvalds

Subject: [PATCH 2/2] atmel_serial: Implement flush_buffer() hook

Avoid dumping garbage to the serial port when the tty is flushed. This
tends to happen when rebooting from a serial console.
Signed-off-by: default avatarHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Acked-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6bb0e3a5
...@@ -955,6 +955,20 @@ static void atmel_shutdown(struct uart_port *port) ...@@ -955,6 +955,20 @@ static void atmel_shutdown(struct uart_port *port)
atmel_close_hook(port); atmel_close_hook(port);
} }
/*
* Flush any TX data submitted for DMA. Called when the TX circular
* buffer is reset.
*/
static void atmel_flush_buffer(struct uart_port *port)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
if (atmel_use_dma_tx(port)) {
UART_PUT_TCR(port, 0);
atmel_port->pdc_tx.ofs = 0;
}
}
/* /*
* Power / Clock management. * Power / Clock management.
*/ */
...@@ -1189,6 +1203,7 @@ static struct uart_ops atmel_pops = { ...@@ -1189,6 +1203,7 @@ static struct uart_ops atmel_pops = {
.break_ctl = atmel_break_ctl, .break_ctl = atmel_break_ctl,
.startup = atmel_startup, .startup = atmel_startup,
.shutdown = atmel_shutdown, .shutdown = atmel_shutdown,
.flush_buffer = atmel_flush_buffer,
.set_termios = atmel_set_termios, .set_termios = atmel_set_termios,
.type = atmel_type, .type = atmel_type,
.release_port = atmel_release_port, .release_port = atmel_release_port,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment