summaryrefslogtreecommitdiff
path: root/drivers/dma/dma-jz4780.c
diff options
context:
space:
mode:
authorIgor Opaniuk <igor.opaniuk@toradex.com>2020-11-19 11:32:30 +0200
committerIgor Opaniuk <igor.opaniuk@toradex.com>2020-11-19 11:32:30 +0200
commiteaa149de4579cb86b511920ac269eccd1facfc83 (patch)
tree394e242dbfb006eb86e7c6e9d699e284adcf325e /drivers/dma/dma-jz4780.c
parent43b625b3ab85828431966c350dc3f9132a51ac27 (diff)
parent685021f75fc48afaf6de76280a601316cde827c2 (diff)
Merge commit '685021f75fc48afaf6de76280a601316cde827c2' into toradex_5.4-2.1.x-imx
Diffstat (limited to 'drivers/dma/dma-jz4780.c')
-rw-r--r--drivers/dma/dma-jz4780.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index 0ecb724b394f..e27043427653 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -639,11 +639,11 @@ static enum dma_status jz4780_dma_tx_status(struct dma_chan *chan,
unsigned long flags;
unsigned long residue = 0;
+ spin_lock_irqsave(&jzchan->vchan.lock, flags);
+
status = dma_cookie_status(chan, cookie, txstate);
if ((status == DMA_COMPLETE) || (txstate == NULL))
- return status;
-
- spin_lock_irqsave(&jzchan->vchan.lock, flags);
+ goto out_unlock_irqrestore;
vdesc = vchan_find_desc(&jzchan->vchan, cookie);
if (vdesc) {
@@ -660,6 +660,7 @@ static enum dma_status jz4780_dma_tx_status(struct dma_chan *chan,
&& jzchan->desc->status & (JZ_DMA_DCS_AR | JZ_DMA_DCS_HLT))
status = DMA_ERROR;
+out_unlock_irqrestore:
spin_unlock_irqrestore(&jzchan->vchan.lock, flags);
return status;
}