linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] serial: sh-sci: Fix port shutdown DMA race conditions
@ 2018-07-06  9:05 Geert Uytterhoeven
  2018-07-06  9:05 ` [PATCH v2 1/3] serial: sh-sci: Postpone DMA release when falling back to PIO Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2018-07-06  9:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Laurent Pinchart, Ulrich Hecht,
	Wolfram Sang
  Cc: linux-serial, linux-renesas-soc, linux-sh, Geert Uytterhoeven

	Hi all,

This patch series fixes race conditions between DMA use and port
shutdown on Renesas "SCIF" serial ports, causing e.g.

    sh-sci e6550000.serial: Failed preparing Tx DMA descriptor
    Unable to handle kernel read from unreadable memory at virtual address 0000000000000000
    ...
    Call trace:
     sci_tx_dma_release+0x50/0xfc
     work_fn_tx+0x128/0x22c
     process_one_work+0x394/0x62c
     worker_thread+0x21c/0x324
     kthread+0x118/0x128
     ret_from_fork+0x10/0x18

I have no guaranteed way to reproducis this issue. I see it sometimes
when doing a partial login on a port running getty, and letting getty
time out.

The first two patches simplify DMA release handling, and make sure the
work function is not called after port shutdown.
The last patch switches the driver to the new
dmaengine_terminate_(a)sync() functions, now DMA release is done from a
single point.

Changes compared to v1:
  - Remove unused variable port in sci_[rt]x_dma_release(),
  - Drop accidentally appended debug version of the real patch series.

Please review. Thanks!

Geert Uytterhoeven (3):
  serial: sh-sci: Postpone DMA release when falling back to PIO
  serial: sh-sci: Stop TX DMA workqueue during port shutdown
  serial: sh-sci: Stop using deprecated dmaengine_terminate_all()

 drivers/tty/serial/sh-sci.c | 95 ++++++++++++++++++-------------------
 1 file changed, 47 insertions(+), 48 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-07-17  9:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-06  9:05 [PATCH v2 0/3] serial: sh-sci: Fix port shutdown DMA race conditions Geert Uytterhoeven
2018-07-06  9:05 ` [PATCH v2 1/3] serial: sh-sci: Postpone DMA release when falling back to PIO Geert Uytterhoeven
2018-07-11 14:40   ` Simon Horman
2018-07-11 15:28     ` Geert Uytterhoeven
2018-07-06  9:05 ` [PATCH v2 2/3] serial: sh-sci: Stop TX DMA workqueue during port shutdown Geert Uytterhoeven
2018-07-11 14:51   ` Simon Horman
2018-07-11 15:15     ` Geert Uytterhoeven
2018-07-13  7:42       ` Simon Horman
2018-07-13  8:00         ` Geert Uytterhoeven
2018-07-17  9:53           ` Simon Horman
2018-07-06  9:05 ` [PATCH v2 3/3] serial: sh-sci: Stop using deprecated dmaengine_terminate_all() Geert Uytterhoeven
2018-07-11 14:54   ` Simon Horman

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).