From: "Sricharan" <sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: 'Robin Murphy' <robin.murphy-5wv7dgnIgG8@public.gmane.org>,
joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
will.deacon-5wv7dgnIgG8@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: RE: [PATCH 1/5] iommu: Allow taking a reference on a group directly
Date: Wed, 9 Nov 2016 19:40:49 +0530 [thread overview]
Message-ID: <000001d23a93$16c04ab0$4440e010$@codeaurora.org> (raw)
In-Reply-To: <3922e1f14d8ecb50440b2d9b0d1123f3c9307fc5.1478695557.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
Hi,
>-----Original Message-----
>From: Robin Murphy [mailto:robin.murphy-5wv7dgnIgG8@public.gmane.org]
>Sent: Wednesday, November 09, 2016 6:17 PM
>To: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org
>Cc: will.deacon-5wv7dgnIgG8@public.gmane.org; sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
>Subject: [PATCH 1/5] iommu: Allow taking a reference on a group directly
>
>iommu_group_get_for_dev() expects that the IOMMU driver's device_group
>callback return a group with a reference held for the given device.
>Whilst allocating a new group is fine, and pci_device_group() correctly
>handles reusing an existing group, there is no general means for IOMMU
>drivers doing their own group lookup to take additional references on an
>existing group pointer without having to also store device pointers or
>resort to elaborate trickery.
>
>Add an IOMMU-driver-specific function to fill the hole.
>
>Signed-off-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
>---
> drivers/iommu/iommu.c | 14 ++++++++++++++
> include/linux/iommu.h | 1 +
> 2 files changed, 15 insertions(+)
>
>diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
>index 9a2f1960873b..b0b052bc6bb5 100644
>--- a/drivers/iommu/iommu.c
>+++ b/drivers/iommu/iommu.c
>@@ -552,6 +552,20 @@ struct iommu_group *iommu_group_get(struct device *dev)
> EXPORT_SYMBOL_GPL(iommu_group_get);
>
> /**
>+ * __iommu_group_get - Increment reference on a group
>+ * @group: the group to use, must not be NULL
>+ *
>+ * This function may be called by internal iommu driver group management
>+ * when the context of a struct device pointer is not available. It is
>+ * not for general use. Returns the given group for convenience.
>+ */
>+struct iommu_group *__iommu_group_get(struct iommu_group *group)
>+{
>+ kobject_get(group->devices_kobj);
>+ return group;
>+}
>+
>+/**
Acked-by: sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Regards,
Sricharan
next prev parent reply other threads:[~2016-11-09 14:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 12:47 [PATCH 1/5] iommu: Allow taking a reference on a group directly Robin Murphy
[not found] ` <3922e1f14d8ecb50440b2d9b0d1123f3c9307fc5.1478695557.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2016-11-09 12:47 ` [PATCH 2/5] iommu/arm-smmu: Fix group refcounting Robin Murphy
2016-11-09 12:47 ` [PATCH 3/5] iommu/amd: " Robin Murphy
2016-11-09 12:47 ` [PATCH 4/5] iommu/mediatek: Fix M4Uv2 " Robin Murphy
2016-11-09 12:47 ` [PATCH 5/5] iommu/mediatek: Fix M4Uv1 " Robin Murphy
2016-11-09 14:10 ` Sricharan [this message]
2016-11-09 17:25 ` [PATCH 1/5] iommu: Allow taking a reference on a group directly Will Deacon
[not found] ` <20161109172543.GI17771-5wv7dgnIgG8@public.gmane.org>
2016-11-09 17:46 ` Robin Murphy
[not found] ` <8b35afe8-7e09-c2d3-91ae-5d2a10da6fc8-5wv7dgnIgG8@public.gmane.org>
2016-11-09 18:00 ` Will Deacon
[not found] ` <20161109180059.GJ17771-5wv7dgnIgG8@public.gmane.org>
2016-11-10 17:28 ` 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='000001d23a93$16c04ab0$4440e010$@codeaurora.org' \
--to=sricharan-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
--cc=will.deacon-5wv7dgnIgG8@public.gmane.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).