From: Thierry Reding <thierry.reding@gmail.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Prathamesh Shete <pshete@nvidia.com>,
joro@8bytes.org, adrian.hunter@intel.com, jonathanh@nvidia.com,
p.zabel@pengutronix.de, linux-mmc@vger.kernel.org,
linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
will@kernel.org, iommu@lists.linux.dev, anrao@nvidia.com,
smangipudi@nvidia.com, kyarlagadda@nvidia.com,
Thierry Reding <treding@nvidia.com>
Subject: Re: [PATCH v10 1/4] iommu: Always define struct iommu_fwspec
Date: Mon, 7 Nov 2022 10:48:31 +0100 [thread overview]
Message-ID: <Y2jUb3UNeEJVekYS@orome> (raw)
In-Reply-To: <4cae5c8d-d6e9-79dc-670d-22ec9fda10a2@arm.com>
[-- Attachment #1: Type: text/plain, Size: 1462 bytes --]
On Thu, Nov 03, 2022 at 05:35:19PM +0000, Robin Murphy wrote:
[...]
> Now, there does happen to be a tacit contract between the ACPI IORT code and
> the Arm SMMU drivers for how SMMU StreamIDs are encoded in their respective
> fwspecs, but it was never intended for wider consumption. If Tegra drivers
> want to have a special relationship with arm-smmu then fair enough, but they
> can do the same as MSM and formalise it somewhere that the SMMU driver
> maintainers are at least aware of, rather than holding the whole generic
> IOMMU API hostage.
Are you talking about qcom_adrena_smmu_is_gpu_device()? That's the only
place I can find where MSM uses iommu_fwspec directly and in a "special"
way.
> Since apparently it wasn't clear, what I was proposing is a driver helper at
> least something like this:
>
> int tegra_arm_smmu_streamid(struct device *dev)
> {
> #ifdef CONFIG_IOMMU_API
> struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev)
>
> if (fwspec && fwspec->num_ids == 1)
> return fwspec->ids[0] & 0xffff;
> #endif
> return -EINVAL;
> }
We actually also use this mechanism on devices that predate the ARM
SMMU, so it'd need to be even more generic. Also, since we need to
access this from a wide range of subsystems, it'd need to be in a
centralized place. Do you think iommu.h would be acceptable for this?
How about if I also add a comment to struct iommu_fwspec about the
intended use?
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-11-07 9:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 10:51 [PATCH] iommu: Always define struct iommu_fwspec Thierry Reding
2022-10-20 11:32 ` Ulf Hansson
2022-10-27 9:11 ` Thierry Reding
2022-10-27 12:07 ` Ulf Hansson
2022-10-28 13:02 ` [PATCH v9 1/4] iommu: Add dummy dev_iommu_fwspec_get() helper Prathamesh Shete
2022-10-28 13:02 ` [PATCH v9 2/4] mmc: sdhci-tegra: Separate Tegra194 and Tegra234 SoC data Prathamesh Shete
2022-10-28 13:02 ` [PATCH v9 3/4] mmc: sdhci-tegra: Add support to program MC stream ID Prathamesh Shete
2022-10-28 13:02 ` [PATCH v9 4/4] mmc: sdhci-tegra: Issue CMD and DAT resets together Prathamesh Shete
2022-11-02 15:27 ` [PATCH v9 1/4] iommu: Add dummy dev_iommu_fwspec_get() helper Ulf Hansson
2022-11-03 4:38 ` [PATCH v10 1/4] iommu: Always define struct iommu_fwspec Prathamesh Shete
2022-11-03 4:38 ` [PATCH v10 2/4] mmc: sdhci-tegra: Separate Tegra194 and Tegra234 SoC data Prathamesh Shete
2022-11-03 4:38 ` [PATCH v10 3/4] mmc: sdhci-tegra: Add support to program MC stream ID Prathamesh Shete
2022-11-03 11:30 ` Robin Murphy
2022-11-03 4:38 ` [PATCH v10 4/4] mmc: sdhci-tegra: Issue CMD and DAT resets together Prathamesh Shete
2022-11-03 10:59 ` [PATCH v10 1/4] iommu: Always define struct iommu_fwspec Ulf Hansson
2022-11-03 12:23 ` Robin Murphy
2022-11-03 14:01 ` Thierry Reding
2022-11-03 14:55 ` Ulf Hansson
2022-11-03 17:35 ` Robin Murphy
2022-11-04 14:35 ` Ulf Hansson
2022-11-07 9:39 ` Thierry Reding
2022-11-04 14:38 ` Thierry Reding
2022-11-07 9:48 ` Thierry Reding [this message]
2022-11-03 12:59 ` [PATCH] " Joerg Roedel
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=Y2jUb3UNeEJVekYS@orome \
--to=thierry.reding@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=anrao@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=kyarlagadda@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pshete@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=smangipudi@nvidia.com \
--cc=treding@nvidia.com \
--cc=ulf.hansson@linaro.org \
--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