From: Jason Gunthorpe <jgg@nvidia•com>
To: Baolu Lu <baolu.lu@linux•intel.com>
Cc: Kevin Tian <kevin.tian@intel•com>, Will Deacon <will@kernel•org>,
"Rafael J. Wysocki" <rafael@kernel•org>,
linuxppc-dev@lists•ozlabs.org, Joerg Roedel <joro@8bytes•org>,
Robin Murphy <robin.murphy@arm•com>,
linux-acpi@vger•kernel.org, iommu@lists•linux.dev,
Nicolin Chen <nicolinc@nvidia•com>,
Nicholas Piggin <npiggin@gmail•com>,
David Woodhouse <dwmw2@infradead•org>,
Len Brown <lenb@kernel•org>
Subject: Re: [PATCH 10/11] iommu: Split iommu_group_add_device()
Date: Thu, 20 Apr 2023 10:09:02 -0300 [thread overview]
Message-ID: <ZEE5bpvzS+tI+MXP@nvidia.com> (raw)
In-Reply-To: <132ceb1f-4559-5a99-af47-1a86a677eae7@linux.intel.com>
On Thu, Apr 20, 2023 at 12:25:11PM +0800, Baolu Lu wrote:
> On 4/20/23 12:11 AM, Jason Gunthorpe wrote:
> > @@ -451,16 +454,17 @@ static int __iommu_probe_device(struct device *dev, struct list_head *group_list
> > goto out_unlock;
> > group = dev->iommu_group;
> > - ret = iommu_group_add_device(group, dev);
> > + gdev = iommu_group_alloc_device(group, dev);
> > mutex_lock(&group->mutex);
> > - if (ret)
> > + if (IS_ERR(gdev)) {
> > + ret = PTR_ERR(gdev);
> > goto err_put_group;
> > + }
> > + list_add_tail(&gdev->list, &group->devices);
>
> Do we need to put
>
> dev->iommu_group = group;
>
> here?
It is done in iommu_init_driver() and iommu_deinit_driver() NULL's it
group = ops->device_group(dev);
if (WARN_ON_ONCE(group == NULL))
group = ERR_PTR(-EINVAL);
if (IS_ERR(group)) {
ret = PTR_ERR(group);
goto err_unlink;
}
dev->iommu_group = group;
Jason
next prev parent reply other threads:[~2023-04-20 15:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 16:11 [PATCH 00/11] Consolidate the probe_device path Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 01/11] iommu: Have __iommu_probe_device() check for already probed devices Jason Gunthorpe
2023-04-26 9:12 ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 02/11] iommu: Use iommu_group_ref_get/put() for dev->iommu_group Jason Gunthorpe
2023-04-26 9:12 ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 03/11] iommu: Inline iommu_group_get_for_dev() into __iommu_probe_device() Jason Gunthorpe
2023-04-26 9:21 ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 04/11] iommu: Simplify the __iommu_group_remove_device() flow Jason Gunthorpe
2023-04-26 9:21 ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 05/11] iommu: Add iommu_init/deinit_driver() paired functions Jason Gunthorpe
2023-04-26 9:41 ` Tian, Kevin
2023-04-26 14:36 ` Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 06/11] iommu: Move the iommu driver sysfs setup into iommu_init/deinit_driver() Jason Gunthorpe
2023-04-26 9:41 ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 07/11] iommu: Do not export iommu_device_link/unlink() Jason Gunthorpe
2023-04-26 9:42 ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 08/11] iommu: Always destroy the iommu_group during iommu_release_device() Jason Gunthorpe
2023-04-20 4:23 ` Baolu Lu
2023-04-26 13:47 ` Jason Gunthorpe
2023-04-26 9:42 ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 09/11] iommu/power: Remove iommu_del_device() Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 10/11] iommu: Split iommu_group_add_device() Jason Gunthorpe
2023-04-20 4:25 ` Baolu Lu
2023-04-20 13:09 ` Jason Gunthorpe [this message]
2023-04-19 16:11 ` [PATCH 11/11] iommu: Avoid locking/unlocking for iommu_probe_device() Jason Gunthorpe
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=ZEE5bpvzS+tI+MXP@nvidia.com \
--to=jgg@nvidia$(echo .)com \
--cc=baolu.lu@linux$(echo .)intel.com \
--cc=dwmw2@infradead$(echo .)org \
--cc=iommu@lists$(echo .)linux.dev \
--cc=joro@8bytes$(echo .)org \
--cc=kevin.tian@intel$(echo .)com \
--cc=lenb@kernel$(echo .)org \
--cc=linux-acpi@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=nicolinc@nvidia$(echo .)com \
--cc=npiggin@gmail$(echo .)com \
--cc=rafael@kernel$(echo .)org \
--cc=robin.murphy@arm$(echo .)com \
--cc=will@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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