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

Commit a7deabb2 authored by Liam Mark's avatar Liam Mark Committed by Gerrit - the friendly Code Review server
Browse files

iommu/io-pgtable-fast: invalidate TLBs on unmap



When not using the "public" fastmap unmap API make sure we
take care of invalidating the TLBs.

Change-Id: Ia74d4ae7d6352bd9ff57247e9fe2ef74daa1ac1c
Signed-off-by: default avatarLiam Mark <lmark@codeaurora.org>
parent 5a2467e5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -255,16 +255,17 @@ void av8l_fast_unmap_public(av8l_fast_iopte *ptep, size_t size)
	__av8l_fast_unmap(ptep, size, true);
}

/* upper layer must take care of TLB invalidation */
static size_t av8l_fast_unmap(struct io_pgtable_ops *ops, unsigned long iova,
			      size_t size)
{
	struct av8l_fast_io_pgtable *data = iof_pgtable_ops_to_data(ops);
	struct io_pgtable *iop = &data->iop;
	av8l_fast_iopte *ptep = iopte_pmd_offset(data->pmds, iova);
	unsigned long nptes = size >> AV8L_FAST_PAGE_SHIFT;

	__av8l_fast_unmap(ptep, size, false);
	dmac_clean_range(ptep, ptep + nptes);
	io_pgtable_tlb_flush_all(iop);

	return size;
}