serial: sh-sci: Submit RX DMA from RX interrupt on (H)SCIF

For DMA receive requests, the driver is only notified by DMA completion
after the whole DMA request has been transferred.  If less data is
received, it will stay stuck until more data arrives.  The driver
handles this by setting up a timer handler from the receive interrupt,
after reception of the first character.

Unlike SCIFA and SCIFB, SCIF and HSCIF don't issue receive interrupts on
reception of individual characters if a receive DMA request is in
progress, so the timer is never set up.

To fix receive DMA on SCIF and HSCIF, submit the receive DMA request
from the receive interrupt handler instead.
In some sense this is similar to the SCIFA/SCIFB behavior, where the
RDRQE (Rx Data Transfer Request Enable) bit is also set from the receive
interrupt handler.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Geert Uytterhoeven 2015-09-18 13:08:26 +02:00 committed by Greg Kroah-Hartman
parent 67f462b069
commit 756981be74
1 changed files with 5 additions and 2 deletions

View File

@ -1317,7 +1317,8 @@ static void rx_timer_fn(unsigned long arg)
spin_unlock_irqrestore(&port->lock, flags);
sci_submit_rx(s);
if (port->type == PORT_SCIFA || port->type == PORT_SCIFB)
sci_submit_rx(s);
}
static void sci_request_dma(struct uart_port *port)
@ -1403,7 +1404,8 @@ static void sci_request_dma(struct uart_port *port)
setup_timer(&s->rx_timer, rx_timer_fn, (unsigned long)s);
sci_submit_rx(s);
if (port->type == PORT_SCIFA || port->type == PORT_SCIFB)
sci_submit_rx(s);
}
}
@ -1442,6 +1444,7 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr)
scr |= SCSCR_RDRQE;
} else {
scr &= ~SCSCR_RIE;
sci_submit_rx(s);
}
serial_port_out(port, SCSCR, scr);
/* Clear current interrupt */