dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: dan.j.williams@intel.com, vkoul@kernel.org
Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com,
	vincent.guittot@linaro.org, baolin.wang@linaro.org,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 5/6] dmaengine: sprd: Fix the right place to configure 2-stage transfer
Date: Mon,  6 May 2019 15:28:32 +0800	[thread overview]
Message-ID: <7eb64b3319cfa1859f2912398700d4204553c028.1557127239.git.baolin.wang@linaro.org> (raw)
In-Reply-To: <cover.1557127239.git.baolin.wang@linaro.org>
In-Reply-To: <cover.1557127239.git.baolin.wang@linaro.org>

From: Eric Long <eric.long@unisoc.com>

Move the 2-stage configuration before configuring the link-list mode,
since we will use some 2-stage configuration to fill the link-list
configuration.

Signed-off-by: Eric Long <eric.long@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 drivers/dma/sprd-dma.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index a01c232..01abed5 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -911,6 +911,12 @@ static int sprd_dma_fill_linklist_desc(struct dma_chan *chan,
 		schan->linklist.virt_addr = 0;
 	}
 
+	/* Set channel mode and trigger mode for 2-stage transfer */
+	schan->chn_mode =
+		(flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK;
+	schan->trg_mode =
+		(flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK;
+
 	sdesc = kzalloc(sizeof(*sdesc), GFP_NOWAIT);
 	if (!sdesc)
 		return NULL;
@@ -944,12 +950,6 @@ static int sprd_dma_fill_linklist_desc(struct dma_chan *chan,
 		}
 	}
 
-	/* Set channel mode and trigger mode for 2-stage transfer */
-	schan->chn_mode =
-		(flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK;
-	schan->trg_mode =
-		(flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK;
-
 	ret = sprd_dma_fill_desc(chan, &sdesc->chn_hw, 0, 0, src, dst, len,
 				 dir, flags, slave_cfg);
 	if (ret) {
-- 
1.7.9.5


  parent reply	other threads:[~2019-05-06  7:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06  7:28 [PATCH v2 0/6] Fix some bugs and add new feature for Spreadtrum DMA engine Baolin Wang
2019-05-06  7:28 ` [PATCH v2 1/6] dmaengine: sprd: Fix the possible crash when getting descriptor status Baolin Wang
2019-05-06  7:28 ` [PATCH v2 2/6] dmaengine: sprd: Add validation of current descriptor in irq handler Baolin Wang
2019-05-06  7:28 ` [PATCH v2 3/6] dmaengine: sprd: Fix the incorrect start for 2-stage destination channels Baolin Wang
2019-05-06  7:28 ` [PATCH v2 4/6] dmaengine: sprd: Fix block length overflow Baolin Wang
2019-05-06  7:28 ` Baolin Wang [this message]
2019-05-06  7:28 ` [PATCH v2 6/6] dmaengine: sprd: Add interrupt support for 2-stage transfer Baolin Wang
2019-05-21 13:54 ` [PATCH v2 0/6] Fix some bugs and add new feature for Spreadtrum DMA engine Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7eb64b3319cfa1859f2912398700d4204553c028.1557127239.git.baolin.wang@linaro.org \
    --to=baolin.wang@linaro.org \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=eric.long@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vkoul@kernel.org \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).