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: 9521157 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 303A56020A for ; Tue, 17 Jan 2017 14:20:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2124B2856B for ; Tue, 17 Jan 2017 14:20:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1627F28570; Tue, 17 Jan 2017 14:20:32 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable 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 BC48628571 for ; Tue, 17 Jan 2017 14:20:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751227AbdAQOUa (ORCPT ); Tue, 17 Jan 2017 09:20:30 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37727 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdAQOU1 (ORCPT ); Tue, 17 Jan 2017 09:20:27 -0500 Received: by mail-wm0-f42.google.com with SMTP id c206so225039154wme.0 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=oMNYfXce+J6v9Rot7x4EUwLm2DTW/MKQfJ1cfm3SfgI3NnWnox0t0mQc9PlIwHl/AU CjP6yNmgXzpJ0SD1pTgV4jlQ7bScsLwFERCZlutkyWgk/KZpBLV0xOKSZ1nHYzzbdws0 0gKn5Iqba2e7cCNdXO6pmpbNZ2wo7VgFmNr+AumCSQUKibAhDhX9fCqfvK6zbg+OJ7mc 4LugvqllGM5FK8JB5dKt6XMyxpqvAEEXmJClOwEqaS7mNcfBd3jWFjEdTl8w67JK7MjN p/iP3n1lF1OGBGZ4nHFLenoyfkFSc5XlYReNO9syBK/zYPljvMTdy0jcEsmlznvfB0JM KO6w== X-Gm-Message-State: AIkVDXLqoJc0feu3HXpnABqeaA8sPh452Ohmcq10tDVgJYQ7Q52cu6h+2ecHRUO+vr0wDTMS 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: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@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) {