dmaengine: imx-sdma: implement channel termination via worker
authorLucas Stach <l.stach@pengutronix.de>
Tue, 6 Nov 2018 03:40:33 +0000 (03:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Dec 2018 08:16:19 +0000 (09:16 +0100)
commit9063f5a99ea76f85935e3e453422d15e7be89b9e
tree22b7bb232b7528c790eaca5f9322551c2ca549bd
parent228bee887467770cda334c94980845f21d7e0b8b
dmaengine: imx-sdma: implement channel termination via worker

commit b8603d2a5795c42f78998e70dc792336e0dc20c9 upstream.

The dmaengine documentation states that device_terminate_all may be
asynchronous and need not wait for the active transfers to stop.

This allows us to move most of the functionality currently implemented
in the sdma channel termination function to run in a worker, outside
of any atomic context. Moving this out of atomic context has two
benefits: we can now sleep while waiting for the channel to terminate,
instead of busy waiting and the freeing of the dma descriptors happens
with IRQs enabled, getting rid of a warning in the dma mapping code.

As the termination is now async, we need to implement the
device_synchronize dma engine function which simply waits for the
worker to finish its execution.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/imx-sdma.c