Skip to content

Commit 2d42d3b

Browse files
konradybciowilldeacon
authored andcommitted
iommu/arm-smmu-qcom: Work around SDM845 Adreno SMMU w/ 16K pages
SDM845's Adreno SMMU is unique in that it actually advertizes support for 16K (and 32M) pages, which doesn't hold for newer SoCs. This however, seems either broken in the hardware implementation, the hypervisor middleware that abstracts the SMMU, or there's a bug in the Linux kernel somewhere down the line that nobody managed to track down. Booting SDM845 with 16K page sizes and drm/msm results in: *** gpu fault: ttbr0=0000000000000000 iova=000100000000c000 dir=READ type=TRANSLATION source=CP (0,0,0,0) right after loading the firmware. The GPU then starts spitting out illegal intstruction errors, as it's quite obvious that it got a bogus pointer. Moreover, it seems like this issue also concerns other implementations of SMMUv2 on Qualcomm SoCs, such as the one on SC7180. Hide 16K support on such instances to work around this. Reported-by: Sumit Semwal <[email protected]> Signed-off-by: Konrad Dybcio <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 3a8990b commit 2d42d3b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,14 @@ static int qcom_smmu_cfg_probe(struct arm_smmu_device *smmu)
345345
return 0;
346346
}
347347

348+
static int qcom_adreno_smmuv2_cfg_probe(struct arm_smmu_device *smmu)
349+
{
350+
/* Support for 16K pages is advertised on some SoCs, but it doesn't seem to work */
351+
smmu->features &= ~ARM_SMMU_FEAT_FMT_AARCH64_16K;
352+
353+
return 0;
354+
}
355+
348356
static void qcom_smmu_write_s2cr(struct arm_smmu_device *smmu, int idx)
349357
{
350358
struct arm_smmu_s2cr *s2cr = smmu->s2crs + idx;
@@ -443,6 +451,7 @@ static const struct arm_smmu_impl sdm845_smmu_500_impl = {
443451

444452
static const struct arm_smmu_impl qcom_adreno_smmu_v2_impl = {
445453
.init_context = qcom_adreno_smmu_init_context,
454+
.cfg_probe = qcom_adreno_smmuv2_cfg_probe,
446455
.def_domain_type = qcom_smmu_def_domain_type,
447456
.alloc_context_bank = qcom_adreno_smmu_alloc_context_bank,
448457
.write_sctlr = qcom_adreno_smmu_write_sctlr,

0 commit comments

Comments
 (0)