From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Ulrich Hecht <uli+renesas@fpond.eu>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Simon Horman <horms@verge.net.au>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
linux-serial@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-sh@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH v5 0/4] serial: sh-sci: Fix fallback to PIO on DMA failure
Date: Mon, 7 Jan 2019 17:23:16 +0100 [thread overview]
Message-ID: <20190107162320.15530-1-geert+renesas@glider.be> (raw)
Hi Greg, Jiri,
When submitting a DMA request fails, the sh-sci driver is supposed to
fall back to PIO. However, this never really worked due to various
reasons (sh-sci driver issues and dmaengine framework limitations).
There are three places where DMA submission can fail, and the driver
should fall back to PIO:
1. sci_dma_rx_complete(),
2. sci_submit_rx(),
3. work_fn_tx().
This patch series fixes fallback to PIO in case 1, which is the only one
that does not work yet in v5.0-rc1.
Changes compared to v4:
- Drop patches to fix case 2, whch have been applied in v5.0-rc1,
- Add patches to extract common helpers and make naming more
consistent,
- Call new helpers sci_dma_rx_chan_invalidate() and
sci_dma_rx_reenable_irq() instead of open-coding.
Changes compared to v3:
- Let sci_submit_rx() return -EAGAIN instead of -1 on failure,
- Check for negative error in sci_submit_rx() caller.
Changes compared to v2:
- Add missing definition of "u16 scr" to sci_dma_rx_complete(),
- Move label handle_pio inside #ifdef to kill defined but not used
compiler warning when CONFIG_SERIAL_SH_SCI_DMA=n,
- Move call to dmaengine_terminate_async() in sci_dma_rx_complete()
inside the spinlock, for symmetry with sci_submit_rx(),
- Move the call sci_submit_rx() in sci_rx_interrupt() up, as it may
fail, rendering the modification of scr unused,
- Split in multiple patches,
- Drop RFC status.
Changes compared to v1:
- Fix fallback in sci_dma_rx_complete(),
- Fallback in the transmit path already works fine,
- Widen audience, but keep RFC.
This has been tested on r8a7791/koelsch, using SCIF1 on debug serial 1,
and SCIFA3 on EXIO-B, by introducing random failures in DMA submission
code. For testing, this series is also available in the
topic/scif-pio-fallback-v5 branch of my renesas-drivers git repository
at
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git.
Thanks!
Geert Uytterhoeven (4):
serial: sh-sci: Extract sci_dma_rx_chan_invalidate()
serial: sh-sci: Extract sci_dma_rx_reenable_irq()
serial: sh-sci: Fix fallback to PIO in sci_dma_rx_complete()
serial: sh-sci: Make RX/TX DMA function names consistent
drivers/tty/serial/sh-sci.c | 71 ++++++++++++++++++++++---------------
1 file changed, 43 insertions(+), 28 deletions(-)
--
2.17.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next reply other threads:[~2019-01-07 16:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-07 16:23 Geert Uytterhoeven [this message]
2019-01-07 16:23 ` [PATCH v5 1/4] serial: sh-sci: Extract sci_dma_rx_chan_invalidate() Geert Uytterhoeven
2019-01-08 14:42 ` Simon Horman
2019-01-09 12:47 ` Ulrich Hecht
2019-01-07 16:23 ` [PATCH v5 2/4] serial: sh-sci: Extract sci_dma_rx_reenable_irq() Geert Uytterhoeven
2019-01-08 14:46 ` Simon Horman
2019-01-09 12:48 ` Ulrich Hecht
2019-01-07 16:23 ` [PATCH v5 3/4] serial: sh-sci: Fix fallback to PIO in sci_dma_rx_complete() Geert Uytterhoeven
2019-01-08 14:48 ` Simon Horman
2019-01-09 12:51 ` Ulrich Hecht
2019-01-07 16:23 ` [PATCH v5 4/4] serial: sh-sci: Make RX/TX DMA function names consistent Geert Uytterhoeven
2019-01-08 14:48 ` Simon Horman
2019-01-09 14:42 ` Ulrich Hecht
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=20190107162320.15530-1-geert+renesas@glider.be \
--to=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=horms@verge.net.au \
--cc=jslaby@suse.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=uli+renesas@fpond.eu \
--cc=wsa+renesas@sang-engineering.com \
--cc=yoshihiro.shimoda.uh@renesas.com \
--cc=ysato@users.sourceforge.jp \
/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).