dmaengine: pl330: Fix hang on dmaengine_terminate_all on certain boards
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Thu, 21 May 2015 00:34:09 +0000 (09:34 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jun 2015 00:03:27 +0000 (17:03 -0700)
commit158769a5f805f326184b432aad7e4753d5f1eee4
tree3d3ac57c0945934d1d5a7f7ad389e7e53d50a584
parent0e20a59580fa602b9ef804ae8b7ca92ab69afd75
dmaengine: pl330: Fix hang on dmaengine_terminate_all on certain boards

commit 81cc6edc08705ac0146fe6ac14a0982a31ce6f3d upstream.

The pl330 device could hang infinitely on certain boards when DMA
channels are terminated.

It was caused by lack of runtime resume when executing
pl330_terminate_all() which calls the _stop() function. _stop() accesses
device register and can loop infinitely while checking for device state.

The hang was confirmed by Dinh Nguyen on Altera SOCFPGA Cyclone V
board during boot. It can be also triggered with:

$ echo 1 > /sys/module/dmatest/parameters/iterations
$ echo dma1chan0 > /sys/module/dmatest/parameters/channel
$ echo 1 > /sys/module/dmatest/parameters/run
$ sleep 1
$ cat /sys/module/dmatest/parameters/run

Reported-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: ae43b3289186 ("ARM: 8202/1: dmaengine: pl330: Add runtime Power Management support v12")
Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/pl330.c