diff options
author | Jason Gunthorpe <[email protected]> | 2023-06-05 21:59:42 -0300 |
---|---|---|
committer | Joerg Roedel <[email protected]> | 2023-07-14 16:14:13 +0200 |
commit | df15d76dcacac2126a4d20ba06c9d7e4b18bad8e (patch) | |
tree | 644355364353ad12cfac3426ff70824c66be54e3 /scripts | |
parent | 7bdb99622f7e7dcaa58bfc2fa98caf23cfc40994 (diff) |
iommu: Simplify the __iommu_group_remove_device() flow
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.
Reviewed-by: Kevin Tian <[email protected]>
Reviewed-by: Lu Baolu <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions