serial: sh-sci: Postpone DMA release when falling back to PIO
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 6 Jul 2018 09:05:41 +0000 (11:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jul 2018 14:41:15 +0000 (16:41 +0200)
commit2c4ee23530ffc022dc22d2fd4b0eb039c6b4c5e9
tree773b2f7f12507d01700803c4e523365c8eb3965c
parentc5a9262fa8bfed0dddc7466ef10fcd292e2af61b
serial: sh-sci: Postpone DMA release when falling back to PIO

When the sh-sci driver detects an issue with DMA during operation, it
falls backs to PIO, and releases all DMA resources.

As releasing DMA resources immediately has no advantages, but
complicates the code, and is susceptible to races, it is better to
postpone this to port shutdown.

This allows to remove the locking from sci_rx_dma_release() and
sci_tx_dma_release(), but requires keeping a copy of the DMA channel
pointers for release during port shutdown.

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