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

Commit 8e21ae55 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "iommu: io-pgtable-arm: make double-map non-fatal"

parents cf7a5625 c5ea9950
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -289,7 +289,6 @@ static void iopte_tblcnt_add(arm_lpae_iopte *table_ptep, int cnt)
}

static bool selftest_running = false;
static bool suppress_map_failures;

static dma_addr_t __arm_lpae_dma_addr(void *pages)
{
@@ -404,7 +403,7 @@ static int arm_lpae_init_pte(struct arm_lpae_io_pgtable *data,

	/* We require an unmap first */
	if (pte & ARM_LPAE_PTE_VALID) {
		BUG_ON(!suppress_map_failures);
		WARN_RATELIMIT(1, "map without unmap\n");
		return -EEXIST;
	}

@@ -1417,7 +1416,6 @@ static void __init arm_lpae_dump_ops(struct io_pgtable_ops *ops)
#define __FAIL(ops, i)	({						\
		WARN(1, "selftest: test failed for fmt idx %d\n", (i));	\
		arm_lpae_dump_ops(ops);					\
		suppress_map_failures = false;				\
		selftest_running = false;				\
		-EFAULT;						\
})
@@ -1504,12 +1502,10 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
							    IOMMU_CACHE))
				return __FAIL(ops, i);

			suppress_map_failures = true;
			/* Overlapping mappings */
			if (!ops->map(ops, iova, iova + size, size,
				      IOMMU_READ | IOMMU_NOEXEC))
				return __FAIL(ops, i);
			suppress_map_failures = false;

			if (!arm_lpae_range_has_specific_mapping(ops, iova,
								 iova, size))
@@ -1655,7 +1651,6 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
	}

	selftest_running = false;
	suppress_map_failures = false;
	return 0;
}