All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: android: ion: Set the length of the DMA sg entries in buffer
@ 2016-01-21 11:57 Jon Medhurst (Tixy)
  2016-01-21 17:39 ` Laura Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Medhurst (Tixy) @ 2016-01-21 11:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Riley Andrews
  Cc: Liviu Dudau, Laura Abbott, devel, linux-kernel

From: Liviu Dudau <Liviu.Dudau@arm.com>

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>
---
 drivers/staging/android/ion/ion.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index e237e9f..df56021 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -251,8 +251,10 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
 	 * 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);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-22 10:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21 11:57 [PATCH] staging: android: ion: Set the length of the DMA sg entries in buffer Jon Medhurst (Tixy)
2016-01-21 17:39 ` Laura Abbott
2016-01-21 20:19   ` Jon Medhurst (Tixy)
2016-01-22  0:58     ` Laura Abbott
2016-01-22  9:43       ` Jon Medhurst (Tixy)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.