|
@@ -106,11 +106,11 @@ static void ion_chunk_heap_free(struct ion_buffer *buffer)
|
|
|
|
|
|
ion_heap_buffer_zero(buffer);
|
|
|
|
|
|
+ if (ion_buffer_cached(buffer))
|
|
|
+ dma_sync_sg_for_device(NULL, table->sgl, table->nents,
|
|
|
+ DMA_BIDIRECTIONAL);
|
|
|
+
|
|
|
for_each_sg(table->sgl, sg, table->nents, i) {
|
|
|
- if (ion_buffer_cached(buffer))
|
|
|
- arm_dma_ops.sync_single_for_device(NULL,
|
|
|
- pfn_to_dma(NULL, page_to_pfn(sg_page(sg))),
|
|
|
- sg_dma_len(sg), DMA_BIDIRECTIONAL);
|
|
|
gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)),
|
|
|
sg_dma_len(sg));
|
|
|
}
|
|
@@ -148,7 +148,6 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data)
|
|
|
pgprot_t pgprot = pgprot_writecombine(PAGE_KERNEL);
|
|
|
int i, ret;
|
|
|
|
|
|
-
|
|
|
chunk_heap = kzalloc(sizeof(struct ion_chunk_heap), GFP_KERNEL);
|
|
|
if (!chunk_heap)
|
|
|
return ERR_PTR(-ENOMEM);
|
|
@@ -181,9 +180,9 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data)
|
|
|
}
|
|
|
free_vm_area(vm_struct);
|
|
|
|
|
|
- arm_dma_ops.sync_single_for_device(NULL,
|
|
|
- pfn_to_dma(NULL, page_to_pfn(phys_to_page(heap_data->base))),
|
|
|
- heap_data->size, DMA_BIDIRECTIONAL);
|
|
|
+ ion_pages_sync_for_device(NULL, pfn_to_page(PFN_DOWN(heap_data->base)),
|
|
|
+ heap_data->size, DMA_BIDIRECTIONAL);
|
|
|
+
|
|
|
gen_pool_add(chunk_heap->pool, chunk_heap->base, heap_data->size, -1);
|
|
|
chunk_heap->heap.ops = &chunk_heap_ops;
|
|
|
chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK;
|