diff options
author | Liviu Dudau <Liviu.Dudau@arm.com> | 2014-06-30 18:31:14 +0100 |
---|---|---|
committer | Andrey Konovalov <andrey.konovalov@linaro.org> | 2015-09-09 21:53:34 +0300 |
commit | 744dadd16aaa425b06cbb33747a07287c6eb2535 (patch) | |
tree | c063dcbe2ffe252f87c367bb9054b8d57a685462 | |
parent | d49c75f0d6dbd479f222e00076b458d6a04113d0 (diff) |
staging: android: ion: Set the length of the DMA sg entries in buffer.
ion_buffer_create() will allocate a buffer and then create a DMA
mapping for it, but it forgot to set the length of the page entries.
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r-- | drivers/staging/android/ion/ion.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 6f4811263557..1d3352af948c 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -252,8 +252,10 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, allocation via dma_map_sg. The implicit contract here is that memory coming from the heaps is ready for dma, ie if it has a cached mapping that mapping has been invalidated */ - for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i) + for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i) { sg_dma_address(sg) = sg_phys(sg); + sg_dma_len(sg) = sg->length; + } mutex_lock(&dev->buffer_lock); ion_buffer_add(dev, buffer); mutex_unlock(&dev->buffer_lock); |