From: Will Deacon <will@kernel.org>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: robin.murphy@arm.com, joro@8bytes.org, jgg@nvidia.com,
thierry.reding@gmail.com, vdumpa@nvidia.com,
jonathanh@nvidia.com, linux-kernel@vger.kernel.org,
iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH v13 06/10] iommu/arm-smmu-v3: Add acpi_smmu_acpi_probe_model for impl
Date: Tue, 27 Aug 2024 14:02:34 +0100 [thread overview]
Message-ID: <20240827130233.GF4772@willie-the-truck> (raw)
In-Reply-To: <8a2629bb98cabb1be72b32c120bb5ed0114b21bc.1724453781.git.nicolinc@nvidia.com>
On Fri, Aug 23, 2024 at 05:10:40PM -0700, Nicolin Chen wrote:
> For model-specific implementation, repurpose the acpi_smmu_get_options()
> to a wider acpi_smmu_acpi_probe_model(). A new model can add to the list
> in this new function.
>
> Suggested-by: Will Deacon <will@kernel.org>
> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> index afdb8a76a72a..ceb31d63f79b 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -4341,18 +4341,28 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
> }
>
> #ifdef CONFIG_ACPI
> -static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu)
> +static int acpi_smmu_iort_probe_model(struct acpi_iort_node *node,
> + struct arm_smmu_device *smmu)
> {
> - switch (model) {
> + struct acpi_iort_smmu_v3 *iort_smmu =
> + (struct acpi_iort_smmu_v3 *)node->node_data;
> +
> + switch (iort_smmu->model) {
> case ACPI_IORT_SMMU_V3_CAVIUM_CN99XX:
> smmu->options |= ARM_SMMU_OPT_PAGE0_REGS_ONLY;
> break;
> case ACPI_IORT_SMMU_V3_HISILICON_HI161X:
> smmu->options |= ARM_SMMU_OPT_SKIP_PREFETCH;
> break;
> + case ACPI_IORT_SMMU_V3_GENERIC:
> + break;
> + default:
> + dev_err(smmu->dev, "Unknown/unsupported IORT model!\n");
> + return -ENXIO;
We probably don't want this 'default' case, otherwise the driver will
need to be updated every time there's a new model.
If you agree, then I can just drop this bit when applying.
Will
next prev parent reply other threads:[~2024-08-27 13:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-24 0:10 [PATCH v13 00/10] Add Tegra241 (Grace) CMDQV Support (part 1/2) Nicolin Chen
2024-08-24 0:10 ` [PATCH v13 01/10] iommu/arm-smmu-v3: Issue a batch of commands to the same cmdq Nicolin Chen
2024-08-24 0:10 ` [PATCH v13 02/10] iommu/arm-smmu-v3: Pass in cmdq pointer to arm_smmu_cmdq_build_sync_cmd Nicolin Chen
2024-08-24 0:10 ` [PATCH v13 03/10] iommu/arm-smmu-v3: Pass in cmdq pointer to arm_smmu_cmdq_init Nicolin Chen
2024-08-24 0:10 ` [PATCH v13 04/10] iommu/arm-smmu-v3: Make symbols public for CONFIG_TEGRA241_CMDQV Nicolin Chen
2024-08-24 0:10 ` [PATCH v13 05/10] iommu/arm-smmu-v3: Add ARM_SMMU_OPT_TEGRA241_CMDQV Nicolin Chen
2024-08-24 0:10 ` [PATCH v13 06/10] iommu/arm-smmu-v3: Add acpi_smmu_acpi_probe_model for impl Nicolin Chen
2024-08-27 13:02 ` Will Deacon [this message]
2024-08-27 15:57 ` Robin Murphy
2024-08-27 16:18 ` Nicolin Chen
2024-08-29 22:50 ` Nicolin Chen
2024-08-24 0:10 ` [PATCH v13 07/10] iommu/arm-smmu-v3: Add struct arm_smmu_impl_ops Nicolin Chen
2024-08-24 0:10 ` [PATCH v13 08/10] iommu/arm-smmu-v3: Add in-kernel support for NVIDIA Tegra241 (Grace) CMDQV Nicolin Chen
2024-08-26 21:44 ` kernel test robot
2024-08-24 0:10 ` [PATCH v13 09/10] iommu/arm-smmu-v3: Start a new batch if new command is not supported Nicolin Chen
2024-08-24 0:10 ` [PATCH v13 10/10] iommu/tegra241-cmdqv: Limit CMDs for VCMDQs of a guest owned VINTF Nicolin Chen
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=20240827130233.GF4772@willie-the-truck \
--to=will@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=thierry.reding@gmail.com \
--cc=vdumpa@nvidia.com \
/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