From patchwork Wed Dec 3 14:09:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 5431031 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4BF31BEEA8 for ; Wed, 3 Dec 2014 14:10:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F8F720272 for ; Wed, 3 Dec 2014 14:10:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E7F1200FE for ; Wed, 3 Dec 2014 14:10:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753110AbaLCOKD (ORCPT ); Wed, 3 Dec 2014 09:10:03 -0500 Received: from www.linutronix.de ([62.245.132.108]:54002 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753104AbaLCOKD (ORCPT ); Wed, 3 Dec 2014 09:10:03 -0500 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1XwAcx-0001yE-3L; Wed, 03 Dec 2014 15:09:59 +0100 From: Sebastian Andrzej Siewior To: Vinod Koul , Dan Williams Cc: dmaengine@vger.kernel.org, linux-usb@vger.kernel.org, Felipe Balbi , Sebastian Andrzej Siewior Subject: [PATCH 1/2] dma: cppi41: wait longer for the HW to return the descriptor Date: Wed, 3 Dec 2014 15:09:49 +0100 Message-Id: <1417615790-29553-1-git-send-email-bigeasy@linutronix.de> X-Mailer: git-send-email 2.1.3 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001, URIBL_BLOCKED=0.001 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/dma/cppi41.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index a58eec3b2cad..cb97b73482da 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) {