aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/cppi41.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2014-12-03 09:09:50 -0500
committerVinod Koul <vinod.koul@intel.com>2014-12-09 04:15:41 -0500
commit754416e10beb067e0bb473e00bf210c6f268e666 (patch)
treef32d3c58ee2589733e971b0a21209358051484fe /drivers/dma/cppi41.c
parent6f9d70568f3128411c49dd049498d0c13cd3bbc1 (diff)
dma: cppi41: add a delay while setting the TD bit
The manual says that we need to (repeatedly) set the TearDown-bit for the endpoint in order to get the active transfer descriptor released. Doing this "real" quick over and over again seems to work but it also seems that the hardware might not have enough time to breathe. So I though, hey lets add a udelay() between between the individual sets of the bit. This change with the g_zero testcase resulted in a warning about missing transfer descriptor (we got the tear-down one). It seems that if the hardware has some time it manages to release the transfer-descriptor on the completion queue after the teaddown descriptor. With this change, I observe that the transfer descriptor is released after 20-30 retry loops. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/cppi41.c')
-rw-r--r--drivers/dma/cppi41.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index 3fb793188b60..b743adf56465 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -1,3 +1,4 @@
1#include <linux/delay.h>
1#include <linux/dmaengine.h> 2#include <linux/dmaengine.h>
2#include <linux/dma-mapping.h> 3#include <linux/dma-mapping.h>
3#include <linux/platform_device.h> 4#include <linux/platform_device.h>
@@ -603,12 +604,16 @@ static int cppi41_tear_down_chan(struct cppi41_channel *c)
603 * descriptor before the TD we fetch it from enqueue, it has to be 604 * descriptor before the TD we fetch it from enqueue, it has to be
604 * there waiting for us. 605 * there waiting for us.
605 */ 606 */
606 if (!c->td_seen && c->td_retry) 607 if (!c->td_seen && c->td_retry) {
608 udelay(1);
607 return -EAGAIN; 609 return -EAGAIN;
608 610 }
609 WARN_ON(!c->td_retry); 611 WARN_ON(!c->td_retry);
612
610 if (!c->td_desc_seen) { 613 if (!c->td_desc_seen) {
611 desc_phys = cppi41_pop_desc(cdd, c->q_num); 614 desc_phys = cppi41_pop_desc(cdd, c->q_num);
615 if (!desc_phys)
616 desc_phys = cppi41_pop_desc(cdd, c->q_comp_num);
612 WARN_ON(!desc_phys); 617 WARN_ON(!desc_phys);
613 } 618 }
614 619