From: Robin Murphy <robin.murphy@arm.com>
To: Tomasz Nowicki <tn@semihalf.com>,
will@kernel.org, joro@8bytes.org, gregory.clement@bootlin.com,
robh+dt@kernel.org, hannah@marvell.com
Cc: devicetree@vger.kernel.org, catalin.marinas@arm.com,
linux-kernel@vger.kernel.org, nadavh@marvell.com,
iommu@lists.linux-foundation.org, mw@semihalf.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 1/4] iommu/arm-smmu: Call configuration impl hook before consuming features
Date: Wed, 15 Jul 2020 11:20:37 +0100 [thread overview]
Message-ID: <def8aa82-bcca-b209-a6b4-81725fc4fbdb@arm.com> (raw)
In-Reply-To: <20200715070649.18733-2-tn@semihalf.com>
On 2020-07-15 08:06, Tomasz Nowicki wrote:
> 'cfg_probe' hook is called at the very end of configuration probing
> procedure and therefore features override and workaround may become
> complex like for ID register fixups. In preparation for adding Marvell
> errata move 'cfg_probe' a bit earlier to have chance to adjust
> the detected features before we start consuming them.
>
> Since the Cavium quirk (the only user) does not alter features
> it is safe to do so.
Sorry for the confusion of failing to match my own intent in the first
place ;)
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
> Suggested-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
> ---
> drivers/iommu/arm-smmu.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 243bc4cb2705..19f906de6420 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1728,7 +1728,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
> unsigned int size;
> u32 id;
> bool cttw_reg, cttw_fw = smmu->features & ARM_SMMU_FEAT_COHERENT_WALK;
> - int i;
> + int i, ret;
>
> dev_notice(smmu->dev, "probing hardware configuration...\n");
> dev_notice(smmu->dev, "SMMUv%d with:\n",
> @@ -1891,6 +1891,12 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
> smmu->features |= ARM_SMMU_FEAT_FMT_AARCH64_64K;
> }
>
> + if (smmu->impl && smmu->impl->cfg_probe) {
> + ret = smmu->impl->cfg_probe(smmu);
> + if (ret)
> + return ret;
> + }
> +
> /* Now we've corralled the various formats, what'll it do? */
> if (smmu->features & ARM_SMMU_FEAT_FMT_AARCH32_S)
> smmu->pgsize_bitmap |= SZ_4K | SZ_64K | SZ_1M | SZ_16M;
> @@ -1918,9 +1924,6 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
> dev_notice(smmu->dev, "\tStage-2: %lu-bit IPA -> %lu-bit PA\n",
> smmu->ipa_size, smmu->pa_size);
>
> - if (smmu->impl && smmu->impl->cfg_probe)
> - return smmu->impl->cfg_probe(smmu);
> -
> return 0;
> }
>
>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2020-07-15 10:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 7:06 [PATCH v4 0/4] Add system mmu support for Armada-806 Tomasz Nowicki
2020-07-15 7:06 ` [PATCH v4 1/4] iommu/arm-smmu: Call configuration impl hook before consuming features Tomasz Nowicki
2020-07-15 10:20 ` Robin Murphy [this message]
2020-07-15 7:06 ` [PATCH v4 2/4] iommu/arm-smmu: Workaround for Marvell Armada-AP806 SoC erratum #582743 Tomasz Nowicki
2020-07-15 10:32 ` Robin Murphy
2020-07-16 7:24 ` Tomasz Nowicki
2020-07-15 7:06 ` [PATCH v4 3/4] dt-bindings: arm-smmu: add compatible string for Marvell Armada-AP806 SMMU-500 Tomasz Nowicki
2020-07-15 10:36 ` Robin Murphy
2020-07-16 7:27 ` Tomasz Nowicki
2020-07-15 7:06 ` [PATCH v4 4/4] arm64: dts: marvell: add SMMU support Tomasz Nowicki
2020-07-18 21:08 ` Gregory CLEMENT
2020-07-16 12:00 ` [PATCH v4 0/4] Add system mmu support for Armada-806 Will Deacon
2020-07-16 12:02 ` Will Deacon
2020-07-16 12:49 ` Marcin Wojtas
2020-07-18 21:07 ` Gregory CLEMENT
2020-10-06 15:16 ` Denis Odintsov
2020-10-07 13:55 ` Marcin Wojtas
2020-10-13 13:08 ` Robin Murphy
2020-10-19 11:41 ` Denis Odintsov
2020-10-23 12:19 ` Tomasz Nowicki
2020-10-23 12:33 ` Robin Murphy
2020-10-23 13:05 ` Tomasz Nowicki
2020-10-23 13:26 ` Denis Odintsov
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=def8aa82-bcca-b209-a6b4-81725fc4fbdb@arm.com \
--to=robin.murphy@arm.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=hannah@marvell.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=robh+dt@kernel.org \
--cc=tn@semihalf.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;
as well as URLs for NNTP newsgroup(s).