From: Liviu Dudau Date: Mon, 30 Jun 2014 17:31:14 +0000 (+0100) Subject: staging: android: ion: Set the length of the DMA sg entries in buffer. X-Git-Tag: submit/tizen/20141203.153721~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fbc1378fe7f002b0437b753031441bef4886cb35;p=platform%2Fkernel%2Flinux-arm64.git 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 --- diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 3d5bf147223..2780b006194 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 comming 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);