[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181009054752.145978-3-joel@joelfernandes.org>
Date: Mon, 8 Oct 2018 22:47:47 -0700
From: "Joel Fernandes (Google)" <joel@...lfernandes.org>
To: stable@...r.kernel.org
Cc: Pierre Yves MORDRET <pierre-yves.mordret@...com>,
Hugues Fruchet <hugues.fruchet@...com>,
Vinod Koul <vinod.koul@...el.com>, gregkh@...uxfoundation.org,
Alexandre Torgue <alexandre.torgue@...com>,
Dan Williams <dan.j.williams@...el.com>,
dmaengine@...r.kernel.org,
"Joel Fernandes (Google)" <joel@...lfernandes.org>,
linux-arm-kernel@...ts.infradead.org (moderated list:ARM/STM32
ARCHITECTURE), linux-kernel@...r.kernel.org,
Maxime Coquelin <mcoquelin.stm32@...il.com>
Subject: [PATCH 2/7] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode
From: Pierre Yves MORDRET <pierre-yves.mordret@...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@...com>
Signed-off-by: Hugues Fruchet <hugues.fruchet@...com>
Signed-off-by: Vinod Koul <vinod.koul@...el.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
Powered by blists - more mailing lists