From: Robin Murphy <robin.murphy@arm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Bibek Kumar Patro <quic_bibekkum@quicinc.com>
Cc: will@kernel.org, joro@8bytes.org, a39.skl@gmail.com,
konrad.dybcio@linaro.org, quic_pkondeti@quicinc.com,
quic_molvera@quicinc.com, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org, qipl.kernel.upstream@quicinc.com
Subject: Re: [PATCH v2 3/3] iommu/arm-smmu: re-enable context caching in smmu reset operation
Date: Thu, 16 Nov 2023 17:04:13 +0000 [thread overview]
Message-ID: <4db1b4d2-0aa9-4640-b7d7-7d18ab64569a@arm.com> (raw)
In-Reply-To: <CAA8EJprHppoN6rg8-rS1F+4kynQqmV1L3OiHFnJ0HyrshywFig@mail.gmail.com>
On 16/11/2023 3:24 pm, Dmitry Baryshkov wrote:
> On Thu, 16 Nov 2023 at 14:45, Bibek Kumar Patro
> <quic_bibekkum@quicinc.com> wrote:
>>
>>
>>
>> On 11/15/2023 4:33 PM, Dmitry Baryshkov wrote:
>>> On Wed, 15 Nov 2023 at 11:45, Bibek Kumar Patro
>>> <quic_bibekkum@quicinc.com> wrote:
>>>>
>>>> On 11/14/2023 7:45 PM, Dmitry Baryshkov wrote:
>>>>> On Tue, 14 Nov 2023 at 15:57, Bibek Kumar Patro
>>>>> <quic_bibekkum@quicinc.com> wrote:
>>>>>>
>>>>>> Context caching is re-enabled in the prefetch buffer for Qualcomm SoCs
>>>>>> through SoC specific reset ops, which is disabled in the default MMU-500
>>>>>> reset ops, but is expected for context banks using ACTLR register to
>>>>>> retain the prefetch value during reset and runtime suspend.
>>>>>
>>>>> Please refer to Documentation/process/submitting-patches.rst and
>>>>> rephrase this following the rules there.
>>>>>
>>>>
>>>> Noted, will go through the description once and rephrase it
>>>> in next version complying with rules.
>>>>
>>>>>>
>>>>>> Signed-off-by: Bibek Kumar Patro <quic_bibekkum@quicinc.com>
>>>>>> ---
>>>>>> drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 25 ++++++++++++++++++----
>>>>>> 1 file changed, 21 insertions(+), 4 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
>>>>>> index 0eaf6f2a2e49..fa867b1d9d16 100644
>>>>>> --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
>>>>>> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
>>>>>> @@ -478,11 +478,28 @@ static int qcom_smmu_def_domain_type(struct device *dev)
>>>>>> return match ? IOMMU_DOMAIN_IDENTITY : 0;
>>>>>> }
>>>>>>
>>>>>> +static int qcom_smmu500_reset(struct arm_smmu_device *smmu)
>>>>>> +{
>>>>>> + int i;
>>>>>> + u32 reg;
>>>>>> +
>>>>>> + arm_mmu500_reset(smmu);
>>>>>> +
>>>>>> + /* Re-enable context caching after reset */
>>>>>> + for (i = 0; i < smmu->num_context_banks; ++i) {
>>>>>> + reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR);
>>>>>> + reg |= CPRE;
>>>>>> + arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_ACTLR, reg);
>>>>>> + }
>>>>>> +
>>>>>> + return 0;
>>>>>> +}
>>>>>> +
>>>>>> static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu)
>>>>>> {
>>>>>> int ret;
>>>>>>
>>>>>> - arm_mmu500_reset(smmu);
>>>>>> + qcom_smmu500_reset(smmu);
>>>>>
>>>>> Is this applicable for sdm845? For all other platforms supported by
>>>>> qcom_smmu_500 implementation?
>>>>>
>>>>
>>>> In arm_mmu500_reset operation drivers/iommu/arm/arm-smmu/arm-smmu-impl.c
>>>> CPRE bit is reset for all SoC based on mmu500 platform, hence for all
>>>> Qualcomm SoCs including sm845 we are setting back the CPRE bit.
>>>
>>> The errata for the CoreLink MMU-500 requires CPRE to be disabled for
>>> all revisions before r2p2. Do we know whether these SoC used CoreLink
>>> MMU-500 and which version of it?
>>>
>>
>> Just checked all these SoCs are using r2p4 revision.
>> So CPRE needs to be enabled back here then?
>
> can be enabled, yes.
There are still open errata #562869 and #1047329 which might need this
workaround. I guess one could argue that we're not (knowingly) using
nested translation at the moment, and also probably not running this in
situations which would end up using short-descriptor format, however
stuff like pKVM and IOMMUFD could potentially change those assumptions
in future, so they still feel a bit sketchy to me.
Thanks,
Robin.
>
>>
>>>>
>>>>>>
>>>>>> /*
>>>>>> * To address performance degradation in non-real time clients,
>>>>>> @@ -509,7 +526,7 @@ static const struct arm_smmu_impl qcom_smmu_500_impl = {
>>>>>> .init_context = qcom_smmu_init_context,
>>>>>> .cfg_probe = qcom_smmu_cfg_probe,
>>>>>> .def_domain_type = qcom_smmu_def_domain_type,
>>>>>> - .reset = arm_mmu500_reset,
>>>>>> + .reset = qcom_smmu500_reset,
>>>>>> .write_s2cr = qcom_smmu_write_s2cr,
>>>>>> .tlb_sync = qcom_smmu_tlb_sync,
>>>>>> };
>>>>>> @@ -528,7 +545,7 @@ static const struct arm_smmu_impl sm8550_smmu_500_impl = {
>>>>>> .init_context = qcom_smmu_init_context,
>>>>>> .cfg_probe = qcom_smmu_cfg_probe,
>>>>>> .def_domain_type = qcom_smmu_def_domain_type,
>>>>>> - .reset = arm_mmu500_reset,
>>>>>> + .reset = qcom_smmu500_reset,
>>>>>> .write_s2cr = qcom_smmu_write_s2cr,
>>>>>> .tlb_sync = qcom_smmu_tlb_sync,
>>>>>> };
>>>>>> @@ -544,7 +561,7 @@ static const struct arm_smmu_impl qcom_adreno_smmu_v2_impl = {
>>>>>> static const struct arm_smmu_impl qcom_adreno_smmu_500_impl = {
>>>>>> .init_context = qcom_adreno_smmu_init_context,
>>>>>> .def_domain_type = qcom_smmu_def_domain_type,
>>>>>> - .reset = arm_mmu500_reset,
>>>>>> + .reset = qcom_smmu500_reset,
>>>>>> .alloc_context_bank = qcom_adreno_smmu_alloc_context_bank,
>>>>>> .write_sctlr = qcom_adreno_smmu_write_sctlr,
>>>>>> .tlb_sync = qcom_smmu_tlb_sync,
>>>>>> --
>>>>>> 2.17.1
>>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>> --
>>> With best wishes
>>> Dmitry
>
>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-11-16 17:04 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 13:56 [PATCH v2 0/3] iommu/arm-smmu: introduction of ACTLR implementation for Qualcomm SoCs Bibek Kumar Patro
2023-11-14 13:56 ` [PATCH v2 1/3] iommu/arm-smmu: introduction of ACTLR for custom prefetcher settings Bibek Kumar Patro
2023-11-14 14:08 ` Dmitry Baryshkov
2023-11-15 5:42 ` Bibek Kumar Patro
2023-11-14 16:55 ` Robin Murphy
2023-11-15 12:32 ` Bibek Kumar Patro
2023-11-15 15:04 ` Robin Murphy
2023-11-20 10:24 ` Bibek Kumar Patro
2023-11-15 13:54 ` Bibek Kumar Patro
2023-11-15 14:53 ` Robin Murphy
2023-11-17 5:27 ` Bibek Kumar Patro
2023-11-14 13:56 ` [PATCH v2 2/3] iommu/arm-smmu: add ACTLR data and support for SM8550 Bibek Kumar Patro
2023-11-14 14:12 ` Dmitry Baryshkov
2023-11-15 9:22 ` Bibek Kumar Patro
2023-11-15 9:38 ` Dmitry Baryshkov
2023-11-15 9:51 ` Bibek Kumar Patro
2023-11-15 10:45 ` Dmitry Baryshkov
2023-11-15 12:49 ` Bibek Kumar Patro
2023-11-15 13:10 ` Dmitry Baryshkov
2023-11-15 16:42 ` Konrad Dybcio
2023-11-16 6:09 ` Bibek Kumar Patro
2023-11-16 6:51 ` Dmitry Baryshkov
2023-11-17 5:36 ` Bibek Kumar Patro
2023-11-14 13:56 ` [PATCH v2 3/3] iommu/arm-smmu: re-enable context caching in smmu reset operation Bibek Kumar Patro
2023-11-14 14:15 ` Dmitry Baryshkov
2023-11-15 9:45 ` Bibek Kumar Patro
2023-11-15 11:03 ` Dmitry Baryshkov
2023-11-16 12:44 ` Bibek Kumar Patro
2023-11-16 15:24 ` Dmitry Baryshkov
2023-11-16 17:04 ` Robin Murphy [this message]
2023-11-17 9:10 ` Bibek Kumar Patro
2023-11-15 16:43 ` Konrad Dybcio
2023-11-17 7:15 ` Bibek Kumar Patro
2023-11-14 14:06 ` [PATCH v2 0/3] iommu/arm-smmu: introduction of ACTLR implementation for Qualcomm SoCs Dmitry Baryshkov
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=4db1b4d2-0aa9-4640-b7d7-7d18ab64569a@arm.com \
--to=robin.murphy@arm.com \
--cc=a39.skl@gmail.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qipl.kernel.upstream@quicinc.com \
--cc=quic_bibekkum@quicinc.com \
--cc=quic_molvera@quicinc.com \
--cc=quic_pkondeti@quicinc.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