[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ptugcisjsh6mdnkhrdhbtetykjpeya4epmlbqbuayst5efgjq4@mzan2bvz74r7>
Date: Sat, 7 Sep 2024 22:25:16 -0500
From: Bjorn Andersson <andersson@...nel.org>
To: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Cc: Rob Clark <robdclark@...il.com>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>, Joerg Roedel <joro@...tes.org>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...ainline.org>, Konrad Dybcio <konradybcio@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, iommu@...ts.linux.dev, linux-arm-msm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH 1/7] iommu/arm-smmu-qcom: apply num_context_bank fixes
for SDM630 / SDM660
On Sat, Sep 07, 2024 at 09:48:12PM GMT, Dmitry Baryshkov wrote:
> The Qualcomm SDM630 / SDM660 platform requires the same kind of
> workaround as MSM8998: some IOMMUs have context banks reserved by
> firmware / TZ, touching those banks resets the board.
>
> Apply the num_context_bank workaround to those two SMMU devices in order
> to allow them to be used by Linux.
>
> Fixes: b812834b5329 ("iommu: arm-smmu-qcom: Add sdm630/msm8998 compatibles for qcom quirks")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Reviewed-by: Bjorn Andersson <andersson@...nel.org>
> ---
> drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
> index 087fb4f6f4d3..13a3e3585c89 100644
> --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
> @@ -288,6 +288,12 @@ static int qcom_smmu_cfg_probe(struct arm_smmu_device *smmu)
> */
> if (of_device_is_compatible(smmu->dev->of_node, "qcom,msm8998-smmu-v2") && smmu->num_context_banks == 13)
> smmu->num_context_banks = 12;
This should now be wrapped in {}
Regards,
Bjorn
> + else if (of_device_is_compatible(smmu->dev->of_node, "qcom,sdm630-smmu-v2")) {
> + if (smmu->num_context_banks == 21) /* SDM630 / SDM660 A2NOC SMMU */
> + smmu->num_context_banks = 7;
> + else if (smmu->num_context_banks == 14) /* SDM630 / SDM660 LPASS SMMU */
> + smmu->num_context_banks = 13;
> + }
>
> /*
> * Some platforms support more than the Arm SMMU architected maximum of
> @@ -350,6 +356,11 @@ static int qcom_adreno_smmuv2_cfg_probe(struct arm_smmu_device *smmu)
> /* Support for 16K pages is advertised on some SoCs, but it doesn't seem to work */
> smmu->features &= ~ARM_SMMU_FEAT_FMT_AARCH64_16K;
>
> + /* TZ protects several last context banks, hide them from Linux */
> + if (of_device_is_compatible(smmu->dev->of_node, "qcom,sdm630-smmu-v2") &&
> + smmu->num_context_banks == 5)
> + smmu->num_context_banks = 2;
> +
> return 0;
> }
>
>
> --
> 2.39.2
>
Powered by blists - more mailing lists