linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-stable] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode
@ 2018-10-17  0:00 Joel Fernandes (Google)
  2018-11-11  1:11 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Fernandes (Google) @ 2018-10-17  0:00 UTC (permalink / raw)
  To: stable
  Cc: Pierre Yves MORDRET, Hugues Fruchet, Vinod Koul, gregkh,
	Alexandre Torgue, Dan Williams, dmaengine,
	Joel Fernandes (Google),
	moderated list:ARM/STM32 ARCHITECTURE, linux-kernel,
	Maxime Coquelin

From: Pierre Yves MORDRET <pierre-yves.mordret@st.com>

commit e57cb3b3f10d005410f09d4598cc6d62b833f2b0 upstream.

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>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 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 4099948b6914..fae7de54f00a 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -441,6 +441,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);
@@ -483,6 +485,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 */
@@ -576,8 +581,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.19.0.605.g01d371f741-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for-stable] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode
  2018-10-17  0:00 [PATCH for-stable] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode Joel Fernandes (Google)
@ 2018-11-11  1:11 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2018-11-11  1:11 UTC (permalink / raw)
  To: Joel Fernandes (Google)
  Cc: stable, Pierre Yves MORDRET, Hugues Fruchet, Vinod Koul,
	Alexandre Torgue, Dan Williams, dmaengine,
	moderated list:ARM/STM32 ARCHITECTURE, linux-kernel,
	Maxime Coquelin

On Tue, Oct 16, 2018 at 05:00:03PM -0700, Joel Fernandes (Google) wrote:
> From: Pierre Yves MORDRET <pierre-yves.mordret@st.com>
> 
> commit e57cb3b3f10d005410f09d4598cc6d62b833f2b0 upstream.
> 
> 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>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
>  drivers/dma/stm32-dma.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

I'm just guessing you want this for 4.14.y?  I've added it there.  If
not, please give me a hint :)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-11  3:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17  0:00 [PATCH for-stable] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode Joel Fernandes (Google)
2018-11-11  1:11 ` Greg KH

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).