Skip to content

Commit

Permalink
serial: 8250_dma: don't bother DMA with small transfers
Browse files Browse the repository at this point in the history
If we would like to send amount of data less than FIFO size we better would do
this via PIO mode. Otherwise the overhead could be significant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Andy Shevchenko authored and Greg Kroah-Hartman committed Feb 2, 2015
1 parent a39d1da commit 9119fba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/tty/serial/8250/8250_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ int serial8250_tx_dma(struct uart_8250_port *p)
return 0;

dma->tx_size = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
if (dma->tx_size < p->port.fifosize) {
ret = -EINVAL;
goto err;
}

desc = dmaengine_prep_slave_single(dma->txchan,
dma->tx_addr + xmit->tail,
Expand Down

0 comments on commit 9119fba

Please sign in to comment.