From patchwork Tue Jan 17 14:20:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 9521153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA7FA6020A for ; Tue, 17 Jan 2017 14:20:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BB6728570 for ; Tue, 17 Jan 2017 14:20:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9089228572; Tue, 17 Jan 2017 14:20:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23B162856B for ; Tue, 17 Jan 2017 14:20:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750787AbdAQOU3 (ORCPT ); Tue, 17 Jan 2017 09:20:29 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36576 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751019AbdAQOU1 (ORCPT ); Tue, 17 Jan 2017 09:20:27 -0500 Received: by mail-wm0-f54.google.com with SMTP id c85so201978905wmi.1 for ; Tue, 17 Jan 2017 06:20:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NiOedfXOHwfqxlfAuZZDIbr3iF4zhpTfJ6BQHg4mxKk=; b=kOYmhxThkKpkjuVeaJ8H4CrhXezkPpR86v73T2NbYK8awtEjz4lrbImB3KtChaYkYV UGcBWRCnQA1IhAzQnqfFofCRNXxy3NblqBmut1AwN894rbFe3OK9qg0IrAp2qCFYNQrh TTIv00jYOv94QEDhfEYiAS6PqwcGUzIdX6o19OIzxMSNQ/7/lYEtHU+BSRMG0dQdsGtj mP9KqNaSeieHawE/3MzagJpcLFY+4GUrMS2Kkga6atMG+xyJb0nGmp6diwrdWAYhi9hJ KUjcUBaQtv8HqGnzvrF7gSOD/edEhouQTptPXVyBfFpcxqfplhpdQmE43r15LlEWGDIu 3J9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NiOedfXOHwfqxlfAuZZDIbr3iF4zhpTfJ6BQHg4mxKk=; b=V84GC8Xk4qUGYHBllYK18IKqqQ9+dRDBG+Fke1gR84wHJUIYWTRs8vsy9+bmaoASoS lH9qsviZXy2QcZF3zCoOcDcYpAVqms7e0GcIAJu821SGxuQsnldkOuPrqGaaQvnEWAAx HZT9S1BdSn8n0zyLJExgis8qs5ar3Ow6mGwHGfgCBS3UtPAoeoMfQ8GvTu91mafn7QIy P1rhT5fvIm5PyyQ79kTtT2mvs0KwPmiuq6psts7rd33D3EMz8SCNFBKsMP0qaEKLPLnu USwGxMzpYoHlqrXfLLExICQJMRmX9zW5Doj7wAq8ugfQc5c3rCT7O8qTOkZa2f4vkHws SkYg== X-Gm-Message-State: AIkVDXJ0fXu/YT4c5hL3GV0RWzoToJIXn1uimSgEvOihq8A52/bX77eJqOAKCYCXKMhgK8TX X-Received: by 10.28.189.134 with SMTP id n128mr15502779wmf.77.1484662826395; Tue, 17 Jan 2017 06:20:26 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id o132sm37203079wmo.17.2017.01.17.06.20.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 06:20:25 -0800 (PST) From: Alexandre Bailon To: vinod.koul@intel.com, robh+dt@kernel.org Cc: dmaengine@vger.kernel.org, nsekhar@ti.com, khilman@baylibre.com, ptitiano@baylibre.com, tony@atomide.com, linux-omap@vger.kernel.org, b-liu@ti.com, sergei.shtylyov@cogentembedded.com, devicetree@vger.kernel.org, Alexandre Bailon Subject: [PATCH v2 3/3] dmaengine: cppi41: Fix teardown warnings Date: Tue, 17 Jan 2017 15:20:16 +0100 Message-Id: <20170117142016.11163-4-abailon@baylibre.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170117142016.11163-1-abailon@baylibre.com> References: <20170117142016.11163-1-abailon@baylibre.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP During the teardown of a RX channel, because there is only one completion queue available for RX channel, descriptor of another channel may be popped which will cause 2 warnings: - the first one because we popped a wrong descriptor (neither the channel's descriptor, nor the teardown descriptor). - the second one happen during the teardown of another channel, because we can't find the channel descriptor (that is, the one that caused the first warning). To avoid that, use one free queue instead of a transmit completion queue. Note that fix doesn't fix all the teardown warnings: I still get some when I run some corner case. Signed-off-by: Alexandre Bailon --- drivers/dma/cppi41.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index aab1e5a..aba741c 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -630,7 +630,7 @@ static int cppi41_tear_down_chan(struct cppi41_channel *c) if (!c->is_tx) { reg |= GCR_STARV_RETRY; reg |= GCR_DESC_TYPE_HOST; - reg |= c->q_comp_num; + reg |= cdd->td_queue.complete; } reg |= GCR_TEARDOWN; cppi_writel(reg, c->gcr_reg); @@ -641,7 +641,7 @@ static int cppi41_tear_down_chan(struct cppi41_channel *c) if (!c->td_seen || !c->td_desc_seen) { desc_phys = cppi41_pop_desc(cdd, cdd->td_queue.complete); - if (!desc_phys) + if (!desc_phys && c->is_tx) desc_phys = cppi41_pop_desc(cdd, c->q_comp_num); if (desc_phys == c->desc_phys) {