]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommufd/device: Add helper to detect the first attach of a group
authorYi Liu <yi.l.liu@intel.com>
Fri, 21 Mar 2025 17:19:28 +0000 (10:19 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 25 Mar 2025 13:18:31 +0000 (10:18 -0300)
commitba1de6cd41d0654245864640b62ae45a1bc01bcd
tree66e0459c4cef3861f96fd02c950ec07e8e2e6116
parent2eaa7f845e149370a162bedb0437c9e26229760c
iommufd/device: Add helper to detect the first attach of a group

The existing code detects the first attach by checking the
igroup->device_list. However, the igroup->hwpt can also be used to detect
the first attach. In future modifications, it is better to check the
igroup->hwpt instead of the device_list. To improve readbility and also
prepare for further modifications on this part, this adds a helper for it.

Link: https://patch.msgid.link/r/20250321171940.7213-7-yi.l.liu@intel.com
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/device.c