serial: sh-sci: Get rid of the workqueue to handle receive DMA requests
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 18 Sep 2015 11:08:25 +0000 (13:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Oct 2015 16:36:10 +0000 (17:36 +0100)
commit67f462b069e9d2087d3fe838584730ecefcf9c66
tree94b9738d83737227ec80bbc68db45ebba7360b67
parente1910fcdb545acd374b38785b46cbefb1b6f01e9
serial: sh-sci: Get rid of the workqueue to handle receive DMA requests

The receive DMA workqueue function work_fn_rx() handles two things:
  1. Reception of a full buffer on completion of a receive DMA request,
  2. Reception of a partial buffer on receive DMA time-out.
The workqueue is kicked by both the receive DMA completion handler, and
by a timer to handle DMA time-out.

As there are always two receive DMA requests active, it's possible that
the receive DMA completion handler is called a second time before the
workqueue function runs.

As the time-out handler re-enables the receive interrupt, an interrupt
may come in before time-out has been fully handled.

Move part 1 into the receive DMA completion handler, and move part 2
into the receive DMA time-out handler, to fix these race conditions.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c