iommu/arm-smmu-qcom: Work around SDM845 Adreno SMMU w/ 16K pages
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Fri, 23 Aug 2024 23:12:01 +0000 (01:12 +0200)
committerWill Deacon <will@kernel.org>
Tue, 27 Aug 2024 12:37:45 +0000 (13:37 +0100)
commit2d42d3ba443706c9164fa0bef4e5fd1c36bc1bd9
tree0a5c1f0b6963226f7edfa4f004b0eb9430479b4b
parent3a8990b8a778219327c5f8ecf10b5d81377b925a
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 <sumit.semwal@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240824-topic-845_gpu_smmu-v2-1-a302b8acc052@quicinc.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c