diff options
author | Dan Williams <dan.j.williams@intel.com> | 2013-10-18 13:35:24 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2013-11-13 19:25:06 -0500 |
commit | 45c463ae924c62af4aa64ded1ca831f334a1db65 (patch) | |
tree | 1087e0630ec29998f15a7fc2a7dbec2a3ff35e80 /include | |
parent | d38a8c622a1b382336c3e152c6caf4e11d1f1b2a (diff) |
dmaengine: reference counted unmap data
Hang a common 'unmap' object off of dma descriptors for the purpose of
providing a unified unmapping interface. The lifetime of a mapping may
span multiple descriptors, so these unmap objects are reference counted
by related descriptor.
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Dave Jiang <dave.jiang@intel.com>
[bzolnier: fix IS_ENABLED() check]
[bzolnier: fix release ordering in dmaengine_destroy_unmap_pool()]
[bzolnier: fix check for success in dmaengine_init_unmap_pool()]
[bzolnier: use mempool_free() instead of kmem_cache_free()]
[bzolnier: add missing unmap->len initializations]
[bzolnier: add __init tag to dmaengine_init_unmap_pool()]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
[djbw: move DMAENGINE=n support to this patch for async_tx]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dmaengine.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 9070050fbcd8..2fe855a7cab1 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -464,9 +464,12 @@ static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx, | |||
464 | tx->unmap = unmap; | 464 | tx->unmap = unmap; |
465 | } | 465 | } |
466 | 466 | ||
467 | void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap); | ||
468 | |||
467 | static inline void dma_descriptor_unmap(struct dma_async_tx_descriptor *tx) | 469 | static inline void dma_descriptor_unmap(struct dma_async_tx_descriptor *tx) |
468 | { | 470 | { |
469 | if (tx->unmap) { | 471 | if (tx->unmap) { |
472 | dmaengine_unmap_put(tx->unmap); | ||
470 | tx->unmap = NULL; | 473 | tx->unmap = NULL; |
471 | } | 474 | } |
472 | } | 475 | } |