[PATCH v5 09/13] iommufd/selftest: Add refcount to mock_iommu_device

Tian, Kevin kevin.tian at intel.com
Sun Oct 27 19:49:59 PDT 2024


> From: Nicolin Chen <nicolinc at nvidia.com>
> Sent: Saturday, October 26, 2024 7:50 AM
> 
> For an iommu_dev that can unplug (so far only this selftest does so), the
> viommu->iommu_dev pointer has no guarantee of its life cycle after it is
> copied from the idev->dev->iommu->iommu_dev.
> 
> Track the user count of the iommu_dev. Postpone the exit routine using a
> completion, if refcount is unbalanced. The refcount inc/dec will be added
> in the following patch.
> 
> Signed-off-by: Nicolin Chen <nicolinc at nvidia.com>

Reviewed-by: Kevin Tian <kevin.tian at intel.com>



More information about the linux-arm-kernel mailing list