aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/virt-dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/virt-dma.c')
-rw-r--r--drivers/dma/virt-dma.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/dma/virt-dma.c b/drivers/dma/virt-dma.c
index a8054fc40cef..6f80432a3f0a 100644
--- a/drivers/dma/virt-dma.c
+++ b/drivers/dma/virt-dma.c
@@ -59,17 +59,28 @@ EXPORT_SYMBOL_GPL(vchan_find_desc);
59static void vchan_complete(unsigned long arg) 59static void vchan_complete(unsigned long arg)
60{ 60{
61 struct virt_dma_chan *vc = (struct virt_dma_chan *)arg; 61 struct virt_dma_chan *vc = (struct virt_dma_chan *)arg;
62 struct virt_dma_desc *vd;
63 dma_async_tx_callback cb = NULL;
64 void *cb_data = NULL;
62 LIST_HEAD(head); 65 LIST_HEAD(head);
63 66
64 spin_lock_irq(&vc->lock); 67 spin_lock_irq(&vc->lock);
65 list_splice_tail_init(&vc->desc_completed, &head); 68 list_splice_tail_init(&vc->desc_completed, &head);
69 vd = vc->cyclic;
70 if (vd) {
71 vc->cyclic = NULL;
72 cb = vd->tx.callback;
73 cb_data = vd->tx.callback_param;
74 }
66 spin_unlock_irq(&vc->lock); 75 spin_unlock_irq(&vc->lock);
67 76
77 if (cb)
78 cb(cb_data);
79
68 while (!list_empty(&head)) { 80 while (!list_empty(&head)) {
69 struct virt_dma_desc *vd = list_first_entry(&head, 81 vd = list_first_entry(&head, struct virt_dma_desc, node);
70 struct virt_dma_desc, node); 82 cb = vd->tx.callback;
71 dma_async_tx_callback cb = vd->tx.callback; 83 cb_data = vd->tx.callback_param;
72 void *cb_data = vd->tx.callback_param;
73 84
74 list_del(&vd->node); 85 list_del(&vd->node);
75 86