From patchwork Tue Nov 6 05:01:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 150244 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3458058ljp; Mon, 5 Nov 2018 21:02:18 -0800 (PST) X-Google-Smtp-Source: AJdET5dIx3IFGFhYVk1acVCchLGsjL8wd6Q8qEc6amGBY0bAx07SUeUgRfhLoWQX0k/lLxQ7gRQu X-Received: by 2002:a62:4784:: with SMTP id p4-v6mr24408320pfi.257.1541480538473; Mon, 05 Nov 2018 21:02:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541480538; cv=none; d=google.com; s=arc-20160816; b=VhUJIj9aPVAJMFqtx7bisdsx6NkywpQ3KpwNHDrAjL4bBrWPzrdAi4MAGlx/BzBmaf KBz5ZmGuRmJKRP3FccrjLn0zZClUbV9Dsw4DGC3IOWaGMgs+JfoEyWeOCR72JXan+rpk objD8m68iXqb8vqAfuAR70NacVKIaQfiORz3OMYlcAvKXXxwl0eaH5Up8JuxYQkq86Cy Mh3IsUEBJJGChilMDR19rQfvrLRnh7xuNwTDcph+TfbCGP1xKSEBZMzL3WLH24dmC2n+ p1ztMLRRn3NGisHTWzqCx9gjcRMoFbEqacPsrHkKu9sykOwz4mnqHSLKZhG9j0o5YTtz 4cEQ== 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=PHE6YmWO2I03SRHpEzS6nYZY/FDxXkflAIij04LAQn+z9lJ3Scm6NQ+mriZioyPv0/ hbf756B97dsZ9eC23oiFgI4mp1ZV1f8E/UkIsEVn1afICifLZwWOJNyRmGX1oBzEeWb7 iqEhJMXHWxADwu9P6PQapZShEJ/CQVmvSdzjuN0tQOOvTTRcr/ANbyuEXYUqbLvmq5ac CZSnj/Kw+BtzkaZDa9UMRkbUJYKFJa7ThoE4b7ZRjj0qk1ydzmVlgB7sIafwJfVGG0PN BpiRcueUthxmcTY9jvRYtAfOHomkiMUi8FyBfH8Cb0A963M2ES6UZkScXkDmqHcWVr68 1CtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=An5a6era; 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 r2-v6si34917974pgk.137.2018.11.05.21.02.18; Mon, 05 Nov 2018 21:02:18 -0800 (PST) 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=An5a6era; 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 S2387485AbeKFOZh (ORCPT + 32 others); Tue, 6 Nov 2018 09:25:37 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44716 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387444AbeKFOZh (ORCPT ); Tue, 6 Nov 2018 09:25:37 -0500 Received: by mail-pf1-f196.google.com with SMTP id j13-v6so5515382pff.11 for ; Mon, 05 Nov 2018 21:02:15 -0800 (PST) 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=An5a6eraHBGxYnTEnYSGMSvJom+BfCzLpM/xs8uLYjgucl2r1i+avUxJxJy1IhaTCo dis9DzuoqlpgedC8n3Hl66n2OZHtyVZVec8W4yQsZK3iBJg804l4GYJnE8zQ/luHWuG+ cj/XqQjPHZrN7wrF9VErJP6wViuwoIvYgy3WI= 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=hWBzcNLcG24Si7ND3YgZxmdG9jD/CxzpqXxYrJQ/4C65dee/Tg+8lSQquWGc0vRZmF 8Hndh313d2z8+Eex9LB31X/1jD1ijPhm2z6bq+88krFVgKYEPnEJMzkFAB66CoCnH0c2 g0/W95Q9fel8LEFeLtyCaDTOUKCLYisVaTBqCJgg7+vm345A2ft0SUPjl1ajzyJcjRWn EKBu+F/CJ1SNBWSwwscbSBYGwCJrZxgskR03ojkAqrw7KON2K0+92Ph/+BwL9FPBC5zZ 3bYO/M2D3qDut7VqPBD1ZAUaOndQvZigexrtdYEKgqWL/WYt5UrDyt5Z17RN49vSaV5e lsnA== X-Gm-Message-State: AGRZ1gKp8bDxgp1hC2wZY75HWOGHJW+3DRryENJ8EMJaM+RmMdV2uquw +ml4m5BJk8k7yyZWDx8gZJoUvQ== X-Received: by 2002:a63:d157:: with SMTP id c23mr6593019pgj.170.1541480534703; Mon, 05 Nov 2018 21:02:14 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id o7-v6sm55735416pfb.23.2018.11.05.21.02.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 21:02:14 -0800 (PST) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org, eric.long@unisoc.com Cc: broonie@kernel.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH 5/7] dmaengine: sprd: Support DMA link-list cyclic callback Date: Tue, 6 Nov 2018 13:01:35 +0800 Message-Id: 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(-) -- 1.7.9.5 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 */