From patchwork Tue Sep 6 18:42:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 9317777 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 D92FA60869 for ; Tue, 6 Sep 2016 18:42:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D40C828E8B for ; Tue, 6 Sep 2016 18:42:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C865C28E91; Tue, 6 Sep 2016 18:42:33 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 7037928E8E for ; Tue, 6 Sep 2016 18:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756482AbcIFSmL (ORCPT ); Tue, 6 Sep 2016 14:42:11 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35357 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756489AbcIFSmG (ORCPT ); Tue, 6 Sep 2016 14:42:06 -0400 Received: by mail-pf0-f194.google.com with SMTP id n24so216765pfb.2; Tue, 06 Sep 2016 11:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=uPWJvhLJ+axoisNVF+jd2TKbMqkdscYMUZ/8YNAQmIk=; b=KARIdCNSYu19+kVs4Y6zK7SkI5ksWpoDT/QjWFzpVyifcASar5V1zWYnTWcOMETuQ1 TxY7ArhaslTycSuquN7neaIV6xJq8LLwy7OjCzXTbxlEmkE8FiVIxbLP0RDsqcOBj15n Bhv/Nvj2Qa+Ly06iOPUaP744PqS/uHY74wyXwhxF3wVrq4+QarHmUpBrAsHrbVtSayvJ g0kzmJpBisMXMFCEmluVs7Q/Ug1xRvCkrU8n1DT/XmvpWIFWLeWSI5Bp5xL1z3KggaDY Zm/DrPcHEgh+kkCOuTjfuQbil9+/lxN8LGFh8RrUS5QZqrRYKsipSc9+u6wAOuaUIi+6 3Fmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=uPWJvhLJ+axoisNVF+jd2TKbMqkdscYMUZ/8YNAQmIk=; b=hJdip6zttHzgHjd1OaEGsisP0wD3lCApNRWsjAEsOrqHJiWi9lOknmaQ7Niz5H3NNW hMMgHJGcO+dpgyayRw6jN2rXdOf1vATs1L771DkY0Dd6PUYl8PoSNWgddhf3a2Kb1G1M QZIgCWcQPzEmv82MDmbs93TzTSbLyc3BpaM7ZEV6ZXnqmG9VEv4ND4CP1jwpXXdxxBU6 lKuC+YsuvucZc1c7Yf7xJnzi+8YH/gFrSI6hxnwWkvo6D3jicU/wNXtcHXgV6syG3Anf fiYj1VG3nEA+96jAEBxLZgr5+F8a8m7p/d12GusOn6dXACUPPysk2LkzJ/+d5Nzluizw GugQ== X-Gm-Message-State: AE9vXwPKLf381jTQzt74nrRcjZFma3E530ZmoqDboYGlDOdsY90SRXL2Sjht15yy7YJDYA== X-Received: by 10.98.68.148 with SMTP id m20mr75881198pfi.0.1473187325874; Tue, 06 Sep 2016 11:42:05 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id xn11sm42839335pac.38.2016.09.06.11.42.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Sep 2016 11:42:05 -0700 (PDT) From: Nicolin Chen To: vinod.koul@intel.com, jonathanh@nvidia.com Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, dmaengine@vger.kernel.org, gnurou@gmail.com, thierry.reding@gmail.com, swarren@wwwdotorg.org, ldewangan@nvidia.com Subject: [PATCH v3 1/2] dmaengine: tegra210-adma: Add pre-check for cyclic callback Date: Tue, 6 Sep 2016 11:42:01 -0700 Message-Id: <75bbbd9f20e0ead30760f47f0fd2ee9b05d49254.1473186743.git.nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ADMA driver will support more than cyclic type of transaction. So this patch limit the cyclic callback for the cyclic type only in order to support other types. Signed-off-by: Nicolin Chen --- drivers/dma/tegra210-adma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c index 09b46f7..5b5d298 100644 --- a/drivers/dma/tegra210-adma.c +++ b/drivers/dma/tegra210-adma.c @@ -111,6 +111,7 @@ struct tegra_adma_desc { size_t buf_len; size_t period_len; size_t num_periods; + bool cyclic; }; /* @@ -408,7 +409,8 @@ static irqreturn_t tegra_adma_isr(int irq, void *dev_id) return IRQ_NONE; } - vchan_cyclic_callback(&tdc->desc->vd); + if (tdc->desc->cyclic) + vchan_cyclic_callback(&tdc->desc->vd); spin_unlock_irqrestore(&tdc->vc.lock, flags); @@ -557,6 +559,7 @@ static struct dma_async_tx_descriptor *tegra_adma_prep_dma_cyclic( if (!desc) return NULL; + desc->cyclic = true; desc->buf_len = buf_len; desc->period_len = period_len; desc->num_periods = buf_len / period_len;