Linux Kernels

staging: android: ion: Set the length of the DMA sg entries in buffer

This change “staging: android: ion: Set the length of the DMA sg entries in buffer” (commit 70bc916) in Linux kernel is authored by Liviu Dudau <Liviu.Dudau [at] arm.com> on Thu Jan 21 11:57:47 2016 +0000.

Description of "staging: android: ion: Set the length of the DMA sg entries in buffer"

The change “staging: android: ion: Set the length of the DMA sg entries in buffer” introduces changes as follows.

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>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 70bc916

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "staging: android: ion: Set the length of the DMA sg entries in buffer"

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 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 e237e9f3312d..df560216d702 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);

The commit for this change in Linux stable tree is 70bc916 (patch).

Last modified: 2020/01/11 09:49