Skip to content

Commit

Permalink
dma: cppi41: start tear down only if channel is busy
Browse files Browse the repository at this point in the history
Start the channel tear down only if the channel is busy, else just
bail out. In some cases its seen that by the time the tear down is
initiated the cppi completes the DMA, especially in ISOCH transfers.

Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
George Cherian authored and Vinod Koul committed Mar 11, 2014
1 parent f967d10 commit 975faae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/dma/cppi41.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,12 +620,15 @@ static int cppi41_stop_chan(struct dma_chan *chan)
u32 desc_phys;
int ret;

desc_phys = lower_32_bits(c->desc_phys);
desc_num = (desc_phys - cdd->descs_phys) / sizeof(struct cppi41_desc);
if (!cdd->chan_busy[desc_num])
return 0;

ret = cppi41_tear_down_chan(c);
if (ret)
return ret;

desc_phys = lower_32_bits(c->desc_phys);
desc_num = (desc_phys - cdd->descs_phys) / sizeof(struct cppi41_desc);
WARN_ON(!cdd->chan_busy[desc_num]);
cdd->chan_busy[desc_num] = NULL;

Expand Down

0 comments on commit 975faae

Please sign in to comment.