Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1566137imm; Fri, 28 Sep 2018 22:50:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV62e+EJOusjkJr5mHIkgdjTsN0szS+jb42j3Zkdv0jNZwV4iuxLrHQDuZxrJZ42jvfP6FO77 X-Received: by 2002:a63:5353:: with SMTP id t19-v6mr1538162pgl.199.1538200247529; Fri, 28 Sep 2018 22:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538200247; cv=none; d=google.com; s=arc-20160816; b=qXpXP3sK5utiL26WJN8raSmjcDuXb/7QbUHGqceO+4Ax3JJCGzWCR0nf2U3nAQOHMQ kqJZkvGYsoc/TpcDORWTTDJZQzt9SohCmN/IyBZALm1eG7Spu0uVpENYe5/kVNnvPCvw Alkiz9CPB7GLyN3T/xtrTwvFRdE9gzcRwI269rRqy47lgcprNC10y6P4VojLriFVaBYT sAoF7cnxcyVw6L4HZM1rk1vqoZt27AxS5kcxuvWKgXnKON8Rs3hZZC0R66fSqSB1REpA Ld/Ooh5y7qNj7iq3D8c3LRXrwlDomzBfnNjdyiNkqMpZ702srfhKmTUyUpxRr1u9BTbD SW5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=Ig1u0SVMDYDTOMNzrGMHK+hoBj16/oLyBxKtaJt37JU=; b=yMOQarWcSjTflW81ykA3kz2+F15rK22G7RV/N/xoRF9ZGmxDT9Tk1jZ6PwIuJWkhhR L9Ah79d1Xjmjo0XPBN76yDAUFCE9WnC3uNlCJGwTA3zgvESo/bYNXrEfwegH/5PJBwFc n3HOR2qiIT7WajIO/aFcn0aEdf9wi2N9eV3ZDRk+hAqnGExDHunk1melufR9cpayD3p6 hmPwfu4aHgqqpPgm4a47AXTA3F0iJ368gtPxJeOe5fXiIISW0NJWqmfrgh8DqGCjZUht Vg8VtXRFZSsZ7i5Ijeu7liKCfOoLD6C8aRT/yvfPaGe48sAc2qyCbp3oSuxvYLDraiiv ZUmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XezMXmNa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5-v6si6935156pgn.314.2018.09.28.22.50.33; Fri, 28 Sep 2018 22:50:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XezMXmNa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727593AbeI2MRU (ORCPT + 99 others); Sat, 29 Sep 2018 08:17:20 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35850 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727393AbeI2MRT (ORCPT ); Sat, 29 Sep 2018 08:17:19 -0400 Received: by mail-pg1-f196.google.com with SMTP id f18-v6so2382002pgv.3 for ; Fri, 28 Sep 2018 22:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Ig1u0SVMDYDTOMNzrGMHK+hoBj16/oLyBxKtaJt37JU=; b=XezMXmNaRKQSJ6O7CK0Mc2+4mFLPQOgXEpsEsnVB2F5WItgYc+VNlacf3o5VCqZ3fZ elgzCOz+EIsJuwUJRO8e04u0P/T/zGFB8JU4R62W9ITRWYlnVAr6Azz4CvLNV64/FPsa si1S4opSex+TcxopZgf4dsOrYXQq5Up/JCEnM= 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:in-reply-to:references; bh=Ig1u0SVMDYDTOMNzrGMHK+hoBj16/oLyBxKtaJt37JU=; b=gcvk2tVMVZAl+5P0/cw+WAFpXqwVcTfyK5cUYixJolmT8vUXcWTt7R4B/RnScUolOc Z3eXRU/MxrmYL5PwzIxS5w46+DD7WuLllb3pcTgdAYfqtyNe4tjrZ4jsHnowNL0X6BI4 a6ILRcuhmartVUsLQRp2anyl+kiSUnL5UQV7Hg47JcrIxalIHJmWqyP5kvFvDv7tDeRt VG/gm31fNIBqRdBQOaMoQzgVZHwqCBMTSJ9Y2cjCJL9eXZwnwZr4Mti0SeQGD/qlwRvP KnzK+cDWgLRvzX1j/GHAGeiSMxHDvl5qXQhFJNwqvEbLA94iQxe/KSDfKl/oIvFX3U0/ uW0g== X-Gm-Message-State: ABuFfojE/Qg14DDmr1xcQwBtr4Jh42Gf2WjKcklscslyYvlBNpQZEiVA 56cfvIGav5rwJVFYjZx8wfUXpg== X-Received: by 2002:a17:902:585:: with SMTP id f5-v6mr1718464plf.7.1538200215637; Fri, 28 Sep 2018 22:50:15 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id i80-v6sm11118049pfi.87.2018.09.28.22.50.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Sep 2018 22:50:14 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org, eric.long@spreadtrum.com Cc: broonie@kernel.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] dmaengine: sprd: Support DMA link-list cyclic callback Date: Sat, 29 Sep 2018 13:49:03 +0800 Message-Id: <5512ed9fc0c63cd05a56defd79ab3b6a60a8acb1.1538199697.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Long The Spreadtrum DMA link-list mode is always one cyclic transfer, so we should clear the SPRD_DMA_LLIST_END flag for the link-list configuration. Moreover add cyclic callback support for the cyclic transfer. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 1b39661..cefe42f 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -463,7 +463,7 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id) struct sprd_dma_desc *sdesc; enum sprd_dma_req_mode req_type; enum sprd_dma_int_type int_type; - bool trans_done = false; + bool trans_done = false, cyclic = false; u32 i; while (irq_status) { @@ -478,13 +478,19 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id) sdesc = schan->cur_desc; - /* Check if the dma request descriptor is done. */ - trans_done = sprd_dma_check_trans_done(sdesc, int_type, - req_type); - if (trans_done == true) { - vchan_cookie_complete(&sdesc->vd); - schan->cur_desc = NULL; - sprd_dma_start(schan); + /* cyclic mode schedule callback */ + cyclic = schan->linklist.phy_addr ? true : false; + if (cyclic == true) { + vchan_cyclic_callback(&sdesc->vd); + } else { + /* Check if the dma request descriptor is done. */ + trans_done = sprd_dma_check_trans_done(sdesc, int_type, + req_type); + if (trans_done == true) { + vchan_cookie_complete(&sdesc->vd); + schan->cur_desc = NULL; + sprd_dma_start(schan); + } } spin_unlock(&schan->vc.lock); } @@ -692,9 +698,6 @@ static int sprd_dma_fill_desc(struct dma_chan *chan, /* link-list configuration */ if (schan->linklist.phy_addr) { - if (sg_index == sglen - 1) - hw->frg_len |= SPRD_DMA_LLIST_END; - hw->cfg |= SPRD_DMA_LINKLIST_EN; /* link-list index */ -- 1.7.9.5