Commit 859da211 authored by Yong Wu's avatar Yong Wu Committed by Will Deacon
Browse files

iommu/io-pgtable-arm-v7s: Use ias to check the valid iova in unmap



Use the ias for the valid iova checking in arm_v7s_unmap. This is a
preparing patch for supporting iova 34bit for MediaTek.

Signed-off-by: default avatarYong Wu <yong.wu@mediatek.com>
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
Reviewed-by: default avatarTomasz Figa <tfiga@chromium.org>
Link: https://lore.kernel.org/r/20210111111914.22211-10-yong.wu@mediatek.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 66a28915
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -711,7 +711,7 @@ static size_t arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned long iova,
{
	struct arm_v7s_io_pgtable *data = io_pgtable_ops_to_data(ops);

	if (WARN_ON(upper_32_bits(iova)))
	if (WARN_ON(iova >= (1ULL << data->iop.cfg.ias)))
		return 0;

	return __arm_v7s_unmap(data, gather, iova, size, 1, data->pgd);