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

Commit 00cc3140 authored by Robin Murphy's avatar Robin Murphy Committed by Matt Wagantall
Browse files

iommu: arm-smmu: set a more appropriate DMA mask



Since we use dma_map_page() as an architecture-independent means of
making page table updates visible to non-coherent SMMUs, we need to
have a suitable DMA mask set to discourage the DMA mapping layer from
creating bounce buffers and flushing those instead, if said page tables
happen to lie outside the default 32-bit mask.

Change-Id: Ic5accfc4da5dff76123d7c524a9da77c9d88a847
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Patch-mainline: iommu @ 5 Mar 2015 18:56:36 +0000
[mitchelh@codeaurora.org: context differences]
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent c8238a31
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2475,6 +2475,13 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
	size = arm_smmu_id_size_to_bits((id >> ID2_OAS_SHIFT) & ID2_OAS_MASK);
	smmu->s2_output_size = min_t(unsigned long, PHYS_MASK_SHIFT, size);

	/*
	 * What the page table walker can address actually depends on which
	 * descriptor format is in use, but since a) we don't know that yet,
	 * and b) it can vary per context bank, this will have to do...
	 */
	dma_set_mask_and_coherent(smmu->dev, DMA_BIT_MASK(size));

	if (smmu->version == ARM_SMMU_V1) {
		smmu->s1_input_size = 32;
	} else {