mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-20 22:01:56 +00:00
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>
This commit is contained in:
parent
d38a8c622a
commit
45c463ae92
2 changed files with 150 additions and 9 deletions
|
@ -464,9 +464,12 @@ static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx,
|
|||
tx->unmap = unmap;
|
||||
}
|
||||
|
||||
void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap);
|
||||
|
||||
static inline void dma_descriptor_unmap(struct dma_async_tx_descriptor *tx)
|
||||
{
|
||||
if (tx->unmap) {
|
||||
dmaengine_unmap_put(tx->unmap);
|
||||
tx->unmap = NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue