From: Heikki Krogerus Date: Wed, 16 Jan 2013 12:08:14 +0000 (+0200) Subject: serial: 8250_dma: TX optimisation X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a3b0397fdf19b3c23f37012532482c787e01d4a0;p=linux-beck.git serial: 8250_dma: TX optimisation Remove one useless wakeup, and do not use DMA with zero byte transfers. Signed-off-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c index 02333fc17f41..b9f7fd28112e 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c @@ -67,12 +67,12 @@ int serial8250_tx_dma(struct uart_8250_port *p) struct circ_buf *xmit = &p->port.state->xmit; struct dma_async_tx_descriptor *desc; - if (dma->tx_running) { - uart_write_wakeup(&p->port); + if (dma->tx_running) return -EBUSY; - } dma->tx_size = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); + if (!dma->tx_size) + return -EINVAL; desc = dmaengine_prep_slave_single(dma->txchan, dma->tx_addr + xmit->tail,