Skip to content

Commit

Permalink
serial: sirf: transfer more bytes once to decrease interrupts
Browse files Browse the repository at this point in the history
the current codes send 1 bytes, then after getting TX done interrupt,
send subsequent bytes. it causes redundant interrupts.
for example, if we have 3 bytes in TX buffer, the TX flow is:
1. send 1 byte
2. get TX down interrupt
3. send the left 2 bytes
4. get TX down interrupt

this patch moves to send more bytes and decrease interrupts, the new
flow is:
1. send 3 bytes
2. get TX down interrupt

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Qipan Li authored and Greg Kroah-Hartman committed Jul 10, 2014
1 parent a997762 commit 7282cec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/tty/serial/sirfsoc_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ static void sirfsoc_uart_start_tx(struct uart_port *port)
if (sirfport->tx_dma_chan)
sirfsoc_uart_tx_with_dma(sirfport);
else {
sirfsoc_uart_pio_tx_chars(sirfport, 1);
sirfsoc_uart_pio_tx_chars(sirfport,
SIRFSOC_UART_IO_TX_REASONABLE_CNT);
wr_regl(port, ureg->sirfsoc_tx_fifo_op, SIRFUART_FIFO_START);
if (!sirfport->is_marco)
wr_regl(port, ureg->sirfsoc_int_en_reg,
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/sirfsoc_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,4 +449,4 @@ struct sirfsoc_uart_port {

/* I/O Mode */
#define SIRFSOC_UART_IO_RX_MAX_CNT 256
#define SIRFSOC_UART_IO_TX_REASONABLE_CNT 6
#define SIRFSOC_UART_IO_TX_REASONABLE_CNT 256

0 comments on commit 7282cec

Please sign in to comment.