linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: pierre-yves.mordret@st.com (Pierre-Yves MORDRET)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1 7/8] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode
Date: Tue, 13 Mar 2018 17:42:06 +0100	[thread overview]
Message-ID: <1520959327-25760-8-git-send-email-pierre-yves.mordret@st.com> (raw)
In-Reply-To: <1520959327-25760-1-git-send-email-pierre-yves.mordret@st.com>

When in cyclic mode, the configuration is updated after having started the
DMA hardware (STM32_DMA_SCR_EN) leading to incomplete configuration of
SMxAR registers.

Signed-off-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
---
  Version history:
    v1:
       * Initial
---
---
 drivers/dma/stm32-dma.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index a11cbee..38c545d 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -538,6 +538,8 @@ static void stm32_dma_dump_reg(struct stm32_dma_chan *chan)
 	dev_dbg(chan2dev(chan), "SFCR:  0x%08x\n", sfcr);
 }
 
+static void stm32_dma_configure_next_sg(struct stm32_dma_chan *chan);
+
 static void stm32_dma_start_transfer(struct stm32_dma_chan *chan)
 {
 	struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan);
@@ -580,6 +582,9 @@ static void stm32_dma_start_transfer(struct stm32_dma_chan *chan)
 	if (status)
 		stm32_dma_irq_clear(chan, status);
 
+	if (chan->desc->cyclic)
+		stm32_dma_configure_next_sg(chan);
+
 	stm32_dma_dump_reg(chan);
 
 	/* Start DMA */
@@ -689,8 +694,7 @@ static void stm32_dma_issue_pending(struct dma_chan *c)
 	if (vchan_issue_pending(&chan->vchan) && !chan->desc && !chan->busy) {
 		dev_dbg(chan2dev(chan), "vchan %p: issued\n", &chan->vchan);
 		stm32_dma_start_transfer(chan);
-		if (chan->desc->cyclic)
-			stm32_dma_configure_next_sg(chan);
+
 	}
 	spin_unlock_irqrestore(&chan->vchan.lock, flags);
 }
-- 
2.7.4

  parent reply	other threads:[~2018-03-13 16:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 16:41 [PATCH v1 0/8] Append several fixes and improvements in STM32 DMA Pierre-Yves MORDRET
2018-03-13 16:42 ` [PATCH v1 1/8] dt-bindings: stm32-dma: introduce DMA features bitfield Pierre-Yves MORDRET
2018-03-18 12:49   ` Rob Herring
2018-03-13 16:42 ` [PATCH v1 2/8] dmaengine: stm32-dma: threshold manages with bitfield feature Pierre-Yves MORDRET
2018-03-13 16:42 ` [PATCH v1 3/8] dmaengine: stm32-dma: Improve memory burst management Pierre-Yves MORDRET
2018-03-13 16:42 ` [PATCH v1 4/8] dmaengine: stm32-dma: fix DMA IRQ status handling Pierre-Yves MORDRET
2018-03-13 16:42 ` [PATCH v1 5/8] dmaengine: stm32-dma: fix max items per transfer Pierre-Yves MORDRET
2018-03-13 16:42 ` [PATCH v1 6/8] dmaengine: stm32-dma: properly mask irq bits Pierre-Yves MORDRET
2018-03-13 16:42 ` Pierre-Yves MORDRET [this message]
2018-03-13 16:42 ` [PATCH v1 8/8] dmaengine: stm32-dma: fix typo and reported checkpatch warnings Pierre-Yves MORDRET
2018-04-04  6:19 ` [PATCH v1 0/8] Append several fixes and improvements in STM32 DMA 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=1520959327-25760-8-git-send-email-pierre-yves.mordret@st.com \
    --to=pierre-yves.mordret@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).