From: Bjorn Andersson <quic_bjorande@quicinc.com>
To: Marc Gonzalez <mgonzalez@freebox.fr>
Cc: Robin Murphy <robin.murphy@arm.com>,
Rob Herring <robh@kernel.org>, Rob Clark <robdclark@gmail.com>,
Will Deacon <will@kernel.org>, Joerg Roedel <joro@8bytes.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, <iommu@lists.linux.dev>,
<linux-arm-msm@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Arnaud Vrac <avrac@freebox.fr>,
Pierre-Hugues Husson <phhusson@freebox.fr>,
Marijn Suijten <marijn.suijten@somainline.org>,
Caleb Connolly <caleb.connolly@linaro.org>
Subject: Re: [PATCH 1/2] dt-bindings: arm-smmu: Add qcom,last-ctx-bank-reserved
Date: Mon, 19 Aug 2024 15:04:41 -0700 [thread overview]
Message-ID: <ZsPBeRTqE9o253Gw@hu-bjorande-lv.qualcomm.com> (raw)
In-Reply-To: <67f9a762-6d14-4557-b1f6-22aabb33f927@freebox.fr>
On Mon, Aug 19, 2024 at 05:02:16PM +0200, Marc Gonzalez wrote:
> On 19/08/2024 14:57, Robin Murphy wrote:
>
> > Luckily, in this case it seems straightforward enough to be able to see
> > that if we have a "qcom,msm8996-smmu-v2" with 13 context banks then we
> > should just treat it as if it has 12 - it's also notable that it only
> > reports NUMSMRG=12, so we couldn't use more than that many S1 context
> > banks at once anyway.
>
> This is what the hypervisor reports:
>
> [ 2.550974] arm-smmu 5100000.iommu: probing hardware configuration...
> [ 2.557309] arm-smmu 5100000.iommu: SMMUv2 with:
> [ 2.563815] arm-smmu 5100000.iommu: stage 1 translation
> [ 2.568494] arm-smmu 5100000.iommu: address translation ops
> [ 2.573791] arm-smmu 5100000.iommu: non-coherent table walk
> [ 2.579434] arm-smmu 5100000.iommu: (IDR0.CTTW overridden by FW configuration)
> [ 2.585088] arm-smmu 5100000.iommu: stream matching with 12 register groups
> [ 2.592132] arm-smmu 5100000.iommu: 13 context banks (0 stage-2 only)
> [ 2.619316] arm-smmu 5100000.iommu: Supported page sizes: 0x63315000
> [ 2.626225] arm-smmu 5100000.iommu: Stage-1: 36-bit VA -> 36-bit IPA
> [ 2.632645] arm-smmu 5100000.iommu: preserved 0 boot mappings
>
>
> smmu->num_mapping_groups = 12
Ignore num_mapping_groups, they are used to define which streams should
be mapped to which context bank. But there's no relationship between
these numbers.
> smmu->num_context_banks = 13
>
>
> Are you saying that
>
> smmu->num_context_banks > smmu->num_mapping_groups
>
> does not make sense?
>
>
> Would a well-placed
>
> if (smmu->num_context_banks > smmu->num_mapping_groups)
> smmu->num_context_banks = smmu->num_mapping_groups;
>
> be a proper work-around?
No, something like this would apply your quirk to other targets (and
specifically it would be wrong, per above).
>
> (Probably in qcom_smmu_cfg_probe() so as to not interfere with other platforms.)
>
>
> Maybe to limit the side effects even more:
>
> if (of_device_is_compatible(smmu->dev->of_node, "qcom,msm8998-smmu-v2") &&
> smmu->num_context_banks > smmu->num_mapping_groups))
> smmu->num_context_banks = smmu->num_mapping_groups;
If we don't want to introduce a more specific compatible for this SMMU
instance, then let's add this to qcom_smmu_cfg_probe():
/* MSM8998 LPASS SMMU reports 13 context banks, but only 12 are accessible */
if (of_device_is_compatible(smmu->dev->of_node, "qcom,msm8998-smmu-v2") && smmu->num_context_banks == 13)
smmu->num_context_banks = 12;
Regards,
Bjorn
>
>
> Neither work-around would require changing the binding.
>
> Is either work-around acceptable, Robin?
>
> Regards
>
>
next prev parent reply other threads:[~2024-08-19 22:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 13:59 [PATCH 0/2] Work around reserved SMMU context bank on msm8998 Marc Gonzalez
2024-08-14 13:59 ` [PATCH 1/2] dt-bindings: arm-smmu: Add qcom,last-ctx-bank-reserved Marc Gonzalez
2024-08-18 15:25 ` Rob Herring
2024-08-19 11:37 ` Marc Gonzalez
2024-08-19 12:57 ` Robin Murphy
2024-08-19 15:02 ` Marc Gonzalez
2024-08-19 22:04 ` Bjorn Andersson [this message]
2024-08-14 13:59 ` [PATCH 2/2] iommu/arm-smmu-qcom: hide last context bank from linux Marc Gonzalez
2024-08-14 15:29 ` Bjorn Andersson
2024-08-14 17:33 ` Marc Gonzalez
2024-08-15 13:01 ` Caleb Connolly
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZsPBeRTqE9o253Gw@hu-bjorande-lv.qualcomm.com \
--to=quic_bjorande@quicinc.com \
--cc=andersson@kernel.org \
--cc=avrac@freebox.fr \
--cc=caleb.connolly@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=mgonzalez@freebox.fr \
--cc=phhusson@freebox.fr \
--cc=robdclark@gmail.com \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®