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

Commit 76bd14ed authored by Laura Abbott's avatar Laura Abbott
Browse files

ion: Always flush using kernel virtual address



Cache operations via userspace address always has a risk of a
page fault. On arm64, userspace addresses are marked as write
protect and fixed up on first accesses. If a userspace address
that has not been written to is invalidated, we will take a
fault, fixup and proceed on. If the mmap semaphore is locked at
the time however we cannot fixup the fault and will abort instead.
Rather than hope the mmap semaphore is not write protected, always
invalidate via the kernel virtual addresses instead.

Change-Id: I71eb0d214cce54ebc82a213ae653f891939f273a
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent 6791a1be
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -228,11 +228,8 @@ static int ion_pages_cache_ops(struct ion_client *client,
			dmac_clean_range(vaddr, vaddr + length);
		break;
	case ION_IOC_INV_CACHES:
		if (!vaddr)
		dma_sync_sg_for_cpu(NULL, table->sgl,
			table->nents, DMA_FROM_DEVICE);
		else
			dmac_inv_range(vaddr, vaddr + length);
		break;
	case ION_IOC_CLEAN_INV_CACHES:
		if (!vaddr) {