Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cd75ce7 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ion: carveout: Use device for cache maintenance"

parents d664828b 8ee1e2bc
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -96,11 +96,12 @@ static void ion_carveout_heap_free(struct ion_buffer *buffer)
	struct sg_table *table = buffer->sg_table;
	struct page *page = sg_page(table->sgl);
	phys_addr_t paddr = page_to_phys(page);
	struct device *dev = (struct device *)heap->priv;

	ion_heap_buffer_zero(buffer);

	if (ion_buffer_cached(buffer))
		dma_sync_sg_for_device(NULL, table->sgl, table->nents,
		ion_pages_sync_for_device(dev, page, buffer->size,
					  DMA_BIDIRECTIONAL);

	ion_carveout_free(heap, paddr, buffer->size);
@@ -123,11 +124,12 @@ struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data)

	struct page *page;
	size_t size;
	struct device *dev = (struct device *)heap_data->priv;

	page = pfn_to_page(PFN_DOWN(heap_data->base));
	size = heap_data->size;

	ion_pages_sync_for_device(NULL, page, size, DMA_BIDIRECTIONAL);
	ion_pages_sync_for_device(dev, page, size, DMA_BIDIRECTIONAL);

	ret = ion_heap_pages_zero(page, size, pgprot_writecombine(PAGE_KERNEL));
	if (ret)