Commit 09d5b702 authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by Vinod Koul

dmaengine: virt-dma: store result on dma descriptor

This allows each virtual channel to store information about each transfer
that completed, i.e. which transfer succeeded (or which failed) and if
there was any residue data on each (completed) transfer.
Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent a08a9645
...@@ -101,7 +101,7 @@ static void vchan_complete(unsigned long arg) ...@@ -101,7 +101,7 @@ static void vchan_complete(unsigned long arg)
} }
spin_unlock_irq(&vc->lock); spin_unlock_irq(&vc->lock);
dmaengine_desc_callback_invoke(&cb, NULL); dmaengine_desc_callback_invoke(&cb, &vd->tx_result);
list_for_each_entry_safe(vd, _vd, &head, node) { list_for_each_entry_safe(vd, _vd, &head, node) {
dmaengine_desc_get_callback(&vd->tx, &cb); dmaengine_desc_get_callback(&vd->tx, &cb);
...@@ -109,7 +109,7 @@ static void vchan_complete(unsigned long arg) ...@@ -109,7 +109,7 @@ static void vchan_complete(unsigned long arg)
list_del(&vd->node); list_del(&vd->node);
vchan_vdesc_fini(vd); vchan_vdesc_fini(vd);
dmaengine_desc_callback_invoke(&cb, NULL); dmaengine_desc_callback_invoke(&cb, &vd->tx_result);
} }
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
struct virt_dma_desc { struct virt_dma_desc {
struct dma_async_tx_descriptor tx; struct dma_async_tx_descriptor tx;
struct dmaengine_result tx_result;
/* protected by vc.lock */ /* protected by vc.lock */
struct list_head node; struct list_head node;
}; };
...@@ -65,6 +66,9 @@ static inline struct dma_async_tx_descriptor *vchan_tx_prep(struct virt_dma_chan ...@@ -65,6 +66,9 @@ static inline struct dma_async_tx_descriptor *vchan_tx_prep(struct virt_dma_chan
vd->tx.tx_submit = vchan_tx_submit; vd->tx.tx_submit = vchan_tx_submit;
vd->tx.desc_free = vchan_tx_desc_free; vd->tx.desc_free = vchan_tx_desc_free;
vd->tx_result.result = DMA_TRANS_NOERROR;
vd->tx_result.residue = 0;
spin_lock_irqsave(&vc->lock, flags); spin_lock_irqsave(&vc->lock, flags);
list_add_tail(&vd->node, &vc->desc_allocated); list_add_tail(&vd->node, &vc->desc_allocated);
spin_unlock_irqrestore(&vc->lock, flags); spin_unlock_irqrestore(&vc->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment