summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2015-08-21 20:02:57 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 17:33:48 +0100
commit99dc8e400e93773fb45c57cc969c7be443d98141 (patch)
tree601794804a0b4865fc9e416b89ed502646489f18
parent8eadb56d6830f169fd225a59e0e27dd97fc762c1 (diff)
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>
-rw-r--r--drivers/tty/serial/sh-sci.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index ffcbf6eaf5f9..d8b73e791a55 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -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);