summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-01-22 13:40:27 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-02 19:11:26 +0100
commit9119fba0cfeda6d415c9f068df66838a104b87cb (patch)
tree53dd37bcf84ef8d0bd4e461b177b34c601d03844 /drivers/tty
parentserial: 8250_core: remove redundant else keyword (diff)
downloadlinux-9119fba0cfeda6d415c9f068df66838a104b87cb.tar.xz
linux-9119fba0cfeda6d415c9f068df66838a104b87cb.zip
serial: 8250_dma: don't bother DMA with small transfers
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>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250_dma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c
index e508939daea3..21d01a491405 100644
--- a/drivers/tty/serial/8250/8250_dma.c
+++ b/drivers/tty/serial/8250/8250_dma.c
@@ -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,