Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c27dbec

Browse files
labbottgregkh
authored andcommitted
staging: android: ion: Stop butchering the DMA address
Now that we have proper caching, stop setting the DMA address manually. It should be set after properly calling dma_map. Signed-off-by: Laura Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 40d59e2 commit c27dbec

File tree

1 file changed

+1
-16
lines changed
  • drivers/staging/android/ion

1 file changed

+1
-16
lines changed

drivers/staging/android/ion/ion.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
8181
{
8282
struct ion_buffer *buffer;
8383
struct sg_table *table;
84-
struct scatterlist *sg;
85-
int i, ret;
84+
int ret;
8685

8786
buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
8887
if (!buffer)
@@ -119,20 +118,6 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
119118
INIT_LIST_HEAD(&buffer->vmas);
120119
INIT_LIST_HEAD(&buffer->attachments);
121120
mutex_init(&buffer->lock);
122-
/*
123-
* this will set up dma addresses for the sglist -- it is not
124-
* technically correct as per the dma api -- a specific
125-
* device isn't really taking ownership here. However, in practice on
126-
* our systems the only dma_address space is physical addresses.
127-
* Additionally, we can't afford the overhead of invalidating every
128-
* allocation via dma_map_sg. The implicit contract here is that
129-
* memory coming from the heaps is ready for dma, ie if it has a
130-
* cached mapping that mapping has been invalidated
131-
*/
132-
for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i) {
133-
sg_dma_address(sg) = sg_phys(sg);
134-
sg_dma_len(sg) = sg->length;
135-
}
136121
mutex_lock(&dev->buffer_lock);
137122
ion_buffer_add(dev, buffer);
138123
mutex_unlock(&dev->buffer_lock);

0 commit comments

Comments
 (0)