From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: SMMU: add devices attached to the SMMU to an IOMMU group
Date: Mon, 14 Oct 2013 13:48:16 +0100 [thread overview]
Message-ID: <20131014124815.GC10491@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1381497887-14586-1-git-send-email-a.motakis@virtualopensystems.com>
Hi Antonios,
On Fri, Oct 11, 2013 at 02:24:46PM +0100, Antonios Motakis wrote:
> IOMMU groups are expected by certain users of the IOMMU API,
> e.g. VFIO. Add new devices found by the SMMU driver to an IOMMU
> group to satisfy those users.
Cheers for looking at this: VFIO has been on my TODO list for some time.
> Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
> ---
> drivers/iommu/arm-smmu.c | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 0f45a48..8b71332 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1502,6 +1502,8 @@ static int arm_smmu_add_device(struct device *dev)
> {
> struct arm_smmu_device *child, *parent, *smmu;
> struct arm_smmu_master *master = NULL;
> + struct iommu_group *group;
> + int ret;
>
> spin_lock(&arm_smmu_devices_lock);
> list_for_each_entry(parent, &arm_smmu_devices, list) {
> @@ -1534,13 +1536,27 @@ static int arm_smmu_add_device(struct device *dev)
> if (!master)
> return -ENODEV;
>
> + group = iommu_group_get(dev);
I'm not especially familiar with IOMMU groups (I understand them as the
minimum translation granularity, which would mean single StreamID for the
ARM SMMU), but under what circumstances would you expect to receive a
non-NULL group here? I can't see any other code adding devices to groups
(outside of other drivers)...
Will
next prev parent reply other threads:[~2013-10-14 12:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 13:24 [PATCH 1/2] ARM: SMMU: add devices attached to the SMMU to an IOMMU group Antonios Motakis
2013-10-11 13:24 ` [PATCH 2/2] ARM: SMMU: return NULL on error in arm_smmu_iova_to_phys Antonios Motakis
2013-10-14 12:48 ` Will Deacon
2013-10-14 15:17 ` Antonios Motakis
2013-10-14 17:09 ` Will Deacon
2013-11-07 18:58 ` Will Deacon
2013-10-14 12:48 ` Will Deacon [this message]
2013-10-14 15:13 ` [PATCH 1/2] ARM: SMMU: add devices attached to the SMMU to an IOMMU group Antonios Motakis
2013-10-14 17:07 ` Will Deacon
2013-10-18 10:29 ` Antonios Motakis
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=20131014124815.GC10491@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).