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

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

Merge "ion: Fix partial cache maintenance issue"

parents c055b66f 76305e44
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -126,6 +126,9 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
		if (!(heap->flags & ION_HEAP_FLAG_DEFER_FREE))
			goto err2;

		if (ret == -EINTR)
			goto err2;

		ion_heap_freelist_drain(heap, 0);
		ret = heap->ops->allocate(heap, buffer, len, flags);
		if (ret)
@@ -559,8 +562,10 @@ static int ion_sgl_sync_range(struct device *dev, struct scatterlist *sgl,
			sg_dma_addr = sg_dma_address(sg);

		len += sg->length;
		if (len <= offset)
		if (len <= offset) {
			sg_dma_addr += sg->length;
			continue;
		}

		sg_left = len - offset;
		sg_offset = sg->length - sg_left;
@@ -1062,7 +1067,7 @@ struct dma_buf *ion_alloc_dmabuf(size_t len, unsigned int heap_id_mask,
		if (!((1 << heap->id) & heap_id_mask))
			continue;
		buffer = ion_buffer_create(heap, dev, len, flags);
		if (!IS_ERR(buffer))
		if (!IS_ERR(buffer) || PTR_ERR(buffer) == -EINTR)
			break;
	}
	up_read(&dev->lock);
+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/swap.h>
#include <linux/sched/signal.h>

#include "ion.h"

@@ -81,6 +82,9 @@ struct page *ion_page_pool_alloc(struct ion_page_pool *pool, bool *from_pool)

	BUG_ON(!pool);

	if (fatal_signal_pending(current))
		return ERR_PTR(-EINTR);

	if (*from_pool && mutex_trylock(&pool->mutex)) {
		if (pool->high_count)
			page = ion_page_pool_remove(pool, true);