diff mbox series

[5/7] dmaengine: mmp_tdma: Log an error if channel is in wrong state

Message ID 20200419164912.670973-6-lkundrak@v3.sk (mailing list archive)
State Accepted
Headers show
Series dmaengine: mmp_tdma: Make the driver actually work | expand

Commit Message

Lubomir Rintel April 19, 2020, 4:49 p.m. UTC
Let's log an error if the channel can't be prepared because it is in an
unexpected state.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 drivers/dma/mmp_tdma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Vinod Koul April 23, 2020, 7:15 a.m. UTC | #1
On 19-04-20, 18:49, Lubomir Rintel wrote:
> Let's log an error if the channel can't be prepared because it is in an
> unexpected state.

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 0b1aa6eab1801..191640f26246d 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -436,8 +436,10 @@  static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic(
 	int num_periods = buf_len / period_len;
 	int i = 0, buf = 0;
 
-	if (tdmac->status != DMA_COMPLETE)
+	if (tdmac->status != DMA_COMPLETE) {
+		dev_err(tdmac->dev, "controller busy");
 		return NULL;
+	}
 
 	if (period_len > TDMA_MAX_XFER_BYTES) {
 		dev_err(tdmac->dev,