From 6f9d70568f3128411c49dd049498d0c13cd3bbc1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 3 Dec 2014 15:09:49 +0100 Subject: dma: cppi41: wait longer for the HW to return the descriptor For a "complete" teardown we have to wait until the teardown descriptor is returned by the hardware. The g_zero testcase "testusb -a -t 9" triggers the following warning quite reliable: |------------[ cut here ]------------ |WARNING: CPU: 0 PID: 0 at drivers/dma/cppi41.c:609 cppi41_dma_control+0x198/0x304() |[] (warn_slowpath_null) from [] |[] (cppi41_dma_control) from [] |[] (cppi41_dma_channel_abort [musb_hdrc]) |[] (nuke.constprop.10 [musb_hdrc]) |[] (musb_gadget_disable [musb_hdrc]) |[] (disable_endpoints [usb_f_ss_lb]) |[] (disable_source_sink [usb_f_ss_lb]) |[] (sourcesink_set_alt [usb_f_ss_lb]) |[] (composite_setup [libcomposite]) |[] (musb_g_ep0_irq [musb_hdrc]) |[] (musb_interrupt [musb_hdrc]) |[] (dsps_interrupt [musb_dsps]) |[] (handle_irq_event_percpu) |[] (handle_irq_event) |[] (handle_level_irq) |[] (generic_handle_irq) |[] (handle_IRQ) |[] (omap3_intc_handle_irq) and complains about a TD descriptor which is not returned. I've been looking at several things and haven't noticed anything unusual that might lead to this. The manual says "to try again" until the descriptor comes out. I limited the amount of retries to 100 retries in order to avoid an infinite number of retries and so a busy-loop. Back then testing revealed that the number of retries were around 20-30 so 100 seemed a good upper limit. This g_zero test reaches without a problem 98 retries and it jumps sometimes to 101 on am335x-evm and so the WARN_ON() triggers. Same test run on beaglebone black and the retries start at 122 and my max value so far was at 128. So lets rise the limit to 500. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Vinod Koul --- drivers/dma/cppi41.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/dma') diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index cf7633f..3fb7931 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -567,7 +567,7 @@ static int cppi41_tear_down_chan(struct cppi41_channel *c) reg |= GCR_TEARDOWN; cppi_writel(reg, c->gcr_reg); c->td_queued = 1; - c->td_retry = 100; + c->td_retry = 500; } if (!c->td_seen || !c->td_desc_seen) { -- cgit v1.1