]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: cppi41: delete channel from pending list when stop channel
authorBin Liu <b-liu@ti.com>
Mon, 12 Nov 2018 15:43:22 +0000 (09:43 -0600)
committerVinod Koul <vkoul@kernel.org>
Wed, 5 Dec 2018 08:31:59 +0000 (14:01 +0530)
commitbad29ec2570cd7312c3e8b26754f68061bcb90e2
treeebe4c43170e93eee4c31e7ab1b74aa42ec7c4546
parent1a42de1e4c9c86996ebc32218de9e54abbcbe476
dmaengine: cppi41: delete channel from pending list when stop channel

The driver defines three states for a cppi channel.
- idle: .chan_busy == 0 && not in .pending list
- pending: .chan_busy == 0 && in .pending list
- busy: .chan_busy == 1 && not in .pending list

There are cases in which the cppi channel could be in the pending state
when cppi41_dma_issue_pending() is called after cppi41_runtime_suspend()
is called.

cppi41_stop_chan() has a bug for these cases to set channels to idle state.
It only checks the .chan_busy flag, but not the .pending list, then later
when cppi41_runtime_resume() is called the channels in .pending list will
be transitioned to busy state.

Removing channels from the .pending list solves the problem.

Fixes: ef604a7af916 ("dma: cppi41: start tear down only if channel is busy")
Cc: stable@vger.kernel.org # v3.15+
Signed-off-by: Bin Liu <b-liu@ti.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/cppi41.c