1
0
Fork 0

serial: sh-sci: Don't call sci_dma_rx_push() if no data has arrived

On receive DMA time-out, avoid calling sci_dma_rx_push() if no data was
transferred by the timed out DMA request.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Geert Uytterhoeven 2015-08-21 20:02:57 +02:00 committed by Greg Kroah-Hartman
parent 8eadb56d68
commit 99dc8e400e
1 changed files with 5 additions and 4 deletions

View File

@ -1467,10 +1467,11 @@ static void work_fn_rx(struct work_struct *work)
dev_dbg(port->dev, "Read %u bytes with cookie %d\n", read,
s->active_rx);
count = sci_dma_rx_push(s, s->rx_buf[new], read);
if (count)
tty_flip_buffer_push(&port->state->port);
if (read) {
count = sci_dma_rx_push(s, s->rx_buf[new], read);
if (count)
tty_flip_buffer_push(&port->state->port);
}
spin_unlock_irqrestore(&port->lock, flags);