diff options
| -rw-r--r-- | drivers/dma/virt-dma.c | 5 | ||||
| -rw-r--r-- | drivers/dma/virt-dma.h | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/drivers/dma/virt-dma.c b/drivers/dma/virt-dma.c index 545e97279083..88ad8ed2a8d6 100644 --- a/drivers/dma/virt-dma.c +++ b/drivers/dma/virt-dma.c | |||
| @@ -107,10 +107,7 @@ static void vchan_complete(unsigned long arg) | |||
| 107 | dmaengine_desc_get_callback(&vd->tx, &cb); | 107 | dmaengine_desc_get_callback(&vd->tx, &cb); |
| 108 | 108 | ||
| 109 | list_del(&vd->node); | 109 | list_del(&vd->node); |
| 110 | if (dmaengine_desc_test_reuse(&vd->tx)) | 110 | vchan_vdesc_fini(vd); |
| 111 | list_add(&vd->node, &vc->desc_allocated); | ||
| 112 | else | ||
| 113 | vc->desc_free(vd); | ||
| 114 | 111 | ||
| 115 | dmaengine_desc_callback_invoke(&cb, NULL); | 112 | dmaengine_desc_callback_invoke(&cb, NULL); |
| 116 | } | 113 | } |
diff --git a/drivers/dma/virt-dma.h b/drivers/dma/virt-dma.h index 3f776a46a29c..2edb05505102 100644 --- a/drivers/dma/virt-dma.h +++ b/drivers/dma/virt-dma.h | |||
| @@ -104,6 +104,20 @@ static inline void vchan_cookie_complete(struct virt_dma_desc *vd) | |||
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | /** | 106 | /** |
| 107 | * vchan_vdesc_fini - Free or reuse a descriptor | ||
| 108 | * @vd: virtual descriptor to free/reuse | ||
| 109 | */ | ||
| 110 | static inline void vchan_vdesc_fini(struct virt_dma_desc *vd) | ||
| 111 | { | ||
| 112 | struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); | ||
| 113 | |||
| 114 | if (dmaengine_desc_test_reuse(&vd->tx)) | ||
| 115 | list_add(&vd->node, &vc->desc_allocated); | ||
| 116 | else | ||
| 117 | vc->desc_free(vd); | ||
| 118 | } | ||
| 119 | |||
| 120 | /** | ||
| 107 | * vchan_cyclic_callback - report the completion of a period | 121 | * vchan_cyclic_callback - report the completion of a period |
| 108 | * @vd: virtual descriptor | 122 | * @vd: virtual descriptor |
| 109 | */ | 123 | */ |
