[PATCH 04/11] iommu: Simplify the __iommu_group_remove_device() flow
Tian, Kevin
kevin.tian at intel.com
Wed Apr 26 19:21:50 AEST 2023
> From: Jason Gunthorpe <jgg at nvidia.com>
> Sent: Thursday, April 20, 2023 12:12 AM
>
> Instead of returning the struct group_device and then later freeing it, do
> the entire free under the group->mutex and defer only putting the
> iommu_group.
>
> It is safe to remove the sysfs_links and free memory while holding that
> mutex.
>
> Move the sanity assert of the group status into
> __iommu_group_free_device().
>
> The next patch will improve upon this and consolidate the group put and
> the mutex into __iommu_group_remove_device().
>
> __iommu_group_free_device() is close to being the paired undo of
> iommu_group_add_device(), following patches will improve on that.
>
> Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian at intel.com>
More information about the Linuxppc-dev
mailing list