Skip to contentSkip to conversation

Patch "staging: android: ion: Set the length of the DMA sg entries in buffer" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Apr 18, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

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

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
staging-android-ion-set-the-length-of-the-dma-sg-entries-in-buffer.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 70bc916b2c80913753fb188d4daee50a64d21ba0 Mon Sep 17 00:00:00 2001

From: Liviu Dudau <[email protected]>
Date: Thu, 21 Jan 2016 11:57:47 +0000
Subject: staging: android: ion: Set the length of the DMA sg entries in buffer

From: Liviu Dudau <[email protected]>

commit 70bc916b2c80913753fb188d4daee50a64d21ba0 upstream.

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.

---
 drivers/staging/android/ion/ion.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/android/ion/ion.c +3 -1
@@ -251,8 +251,10 @@ static struct ion_buffer *ion_buffer_cre
 	 * 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);

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/staging-android-ion-set-the-length-of-the-dma-sg-entries-in-buffer.patch