From patchwork Sat Sep 3 00:32:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 9311813 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 6510460760 for ; Sat, 3 Sep 2016 00:34:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 560F829884 for ; Sat, 3 Sep 2016 00:34:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A83C2988A; Sat, 3 Sep 2016 00:34:54 +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 DFEB229880 for ; Sat, 3 Sep 2016 00:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752551AbcICAeL (ORCPT ); Fri, 2 Sep 2016 20:34:11 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:32986 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752226AbcICAeJ (ORCPT ); Fri, 2 Sep 2016 20:34:09 -0400 Received: by mail-pa0-f66.google.com with SMTP id vy10so6105007pac.0; Fri, 02 Sep 2016 17:32:56 -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=wPf1adTYfCbZb7fNVVvOCRo3FuG2QGV/gcHcm8iJtro=; b=pyyLLWMtx3nGif+kGG45aeeMeq0/xycGISoDYNz/PpJF/X9HgAZV5wy7paTSMZCXn1 G7Chw9Ia5sDvRBs1NnJwh5Szp5VVCLKpws6hc7+FcnM7LMPTkoJM5akqT6HZxlHRl9W8 /JaW5Pp4bWQZiwDxb40DdBaw7ZjQ8bVJz07w9hyllpzUNUkvNVKtIr6CkA8dq8Y53Q9y idqYF5itKz3nQPK5k6ThlsycRx2nlargXe/6+YhOS7YpGaL5pGd0x/gm8qWoYuFW+isc dm2Sr+z5nQSjQ15O9+0D0HbBhWUz5xb0e60JuXzdB+8t1F+CX70+ITOZids6go1/X9om JEBQ== 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=wPf1adTYfCbZb7fNVVvOCRo3FuG2QGV/gcHcm8iJtro=; b=XKi7SC8MB82kLGJOxbNo8ldQXIx7XrP2pFaM6pMdgMzypKGuNlWQZaC1HBEo6mdEpm IgmCAIsgawwyG31GU/MYngu2BEC5YvEDBV8+G9dksRbIytayHwoWpsypi813aYpRaDej Hk+HOQzOqiZ68hRK1qwR24Xx24jIdcwclTAJU2uIQD7ifM2kRe/xD/bSfe4K/B7/RI0R 4VI1laG8lBOvJzjQ7/Hf0ZZJ7reumenfpGowgklwCnwZschucy2DZg6t8pECm1bn9p0W vezSFeO57o4yXjzZReoPbZigv+5zDoOIbwdrBWvEL9t7HrqS2/xiLuuBFTFuYiBDXIVp KbpA== X-Gm-Message-State: AE9vXwMzbOeOcRoy+r8k6jxUlnY8MFb3EHgbTFHhbvUXSaLIYegFrGInZ3YFbaiYsgf82g== X-Received: by 10.66.14.161 with SMTP id q1mr41510419pac.103.1472862775990; Fri, 02 Sep 2016 17:32:55 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id o80sm17285598pfa.67.2016.09.02.17.32.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Sep 2016 17:32:55 -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 v2 1/2] dmaengine: tegra210-adma: Add pre-check for cyclic callback Date: Fri, 2 Sep 2016 17:32:48 -0700 Message-Id: <75bbbd9f20e0ead30760f47f0fd2ee9b05d49254.1472857934.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 limits 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;