From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>
Cc: Muhammad Hamza Farooq <mfarooq@visteon.com>,
Magnus Damm <magnus.damm@gmail.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
Nobuhiro Iwamatsu <iwamatsu@nigauri.org>,
Yoshihiro Kaneko <ykaneko0929@gmail.com>,
Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>,
Koji Matsuoka <koji.matsuoka.xm@renesas.com>,
Wolfram Sang <wsa@the-dreams.de>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
linux-serial@vger.kernel.org, linux-sh@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH v4 03/10] serial: sh-sci: Submit RX DMA from RX interrupt on (H)SCIF
Date: Fri, 18 Sep 2015 11:08:26 +0000 [thread overview]
Message-ID: <1442574513-20648-4-git-send-email-geert+renesas@glider.be> (raw)
In-Reply-To: <1442574513-20648-1-git-send-email-geert+renesas@glider.be>
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>
---
v4:
- Dropped RFC status,
- Rebased on top of "[PATCH] serial: sh-sci: Shuffle functions
around", hence the forward declaration of sci_submit_rx() is no
longer needed, and the declared-but-never-defined compiler warning
if CONFIG_SERIAL_SH_SCI_DMA=n is gone.
v3:
- New, this replaces the one-byte DMA transfer from "[PATCH/RFC v2
28/29] serial: sh-sci: Add (H)SCIF DMA support".
---
drivers/tty/serial/sh-sci.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index eb2b369b1cf1be0b..02aaf4d213d9c280 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -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 */
--
1.9.1
next prev parent reply other threads:[~2015-09-18 11:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 11:08 [PATCH v4 00/10] serial: sh-sci: Add DT DMA support Geert Uytterhoeven
2015-09-18 11:08 ` [PATCH v4 01/10] serial: sh-sci: Shuffle functions around Geert Uytterhoeven
2015-09-18 11:08 ` [PATCH v4 02/10] serial: sh-sci: Get rid of the workqueue to handle receive DMA requests Geert Uytterhoeven
2015-09-18 11:08 ` Geert Uytterhoeven [this message]
2015-09-18 11:08 ` [PATCH v4 04/10] serial: sh-sci: Stop calling sci_start_rx() from sci_request_dma() Geert Uytterhoeven
2015-09-18 11:08 ` [PATCH v4 05/10] serial: sh-sci: Remove timer on shutdown of port Geert Uytterhoeven
2015-09-18 11:08 ` [PATCH v4 06/10] serial: sh-sci: Redirect port interrupts to CPU _only_ when DMA stops Geert Uytterhoeven
2015-09-18 11:08 ` [PATCH v4 07/10] serial: sh-sci: Call dma_async_issue_pending when transaction completes Geert Uytterhoeven
2015-09-18 11:08 ` [PATCH v4 08/10] serial: sh-sci: Do not terminate DMA engine when race condition occurs Geert Uytterhoeven
2015-09-18 11:08 ` [PATCH v4 09/10] serial: sh-sci: Pause DMA engine and get DMA status again Geert Uytterhoeven
2015-09-18 11:08 ` [PATCH v4 10/10] serial: sh-sci: Add DT support to DMA setup Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442574513-20648-4-git-send-email-geert+renesas@glider.be \
--to=geert+renesas@glider.be \
--cc=g.liakhovetski@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=iwamatsu@nigauri.org \
--cc=jslaby@suse.com \
--cc=kazuya.mizuguchi.ks@renesas.com \
--cc=koji.matsuoka.xm@renesas.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-serial@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mfarooq@visteon.com \
--cc=wsa@the-dreams.de \
--cc=ykaneko0929@gmail.com \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).