aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Cherian <george.cherian@ti.com>2014-02-27 00:14:40 -0500
committerVinod Koul <vinod.koul@intel.com>2014-03-11 06:52:43 -0400
commit975faaeb9985af9774007277fdb36b3dc897f4c3 (patch)
treeb9cdf451b48f25ad3752820463d0dc29f862b625
parentf967d104b661c25a9a396e42a1f8ebe3431adc23 (diff)
dma: cppi41: start tear down only if channel is busy
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>
-rw-r--r--drivers/dma/cppi41.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index c18aebf7d5aa..d028f36ae655 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -620,12 +620,15 @@ static int cppi41_stop_chan(struct dma_chan *chan)
620 u32 desc_phys; 620 u32 desc_phys;
621 int ret; 621 int ret;
622 622
623 desc_phys = lower_32_bits(c->desc_phys);
624 desc_num = (desc_phys - cdd->descs_phys) / sizeof(struct cppi41_desc);
625 if (!cdd->chan_busy[desc_num])
626 return 0;
627
623 ret = cppi41_tear_down_chan(c); 628 ret = cppi41_tear_down_chan(c);
624 if (ret) 629 if (ret)
625 return ret; 630 return ret;
626 631
627 desc_phys = lower_32_bits(c->desc_phys);
628 desc_num = (desc_phys - cdd->descs_phys) / sizeof(struct cppi41_desc);
629 WARN_ON(!cdd->chan_busy[desc_num]); 632 WARN_ON(!cdd->chan_busy[desc_num]);
630 cdd->chan_busy[desc_num] = NULL; 633 cdd->chan_busy[desc_num] = NULL;
631 634