diff options
author | Vasant Hegde <vasant.hegde@amd.com> | 2023-06-09 12:51:46 +0200 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2023-07-14 16:16:44 +0200 |
commit | d269ab61f4f8c56999fd26ade86def26db1fed09 (patch) | |
tree | 2d260be8f5ed9b2c579a9548fa3109fca4d49434 | |
parent | iommu/amd/iommu_v2: Fix pasid_state refcount dec hit 0 warning on pasid unbind (diff) | |
download | linux-d269ab61f4f8c56999fd26ade86def26db1fed09.tar.xz linux-d269ab61f4f8c56999fd26ade86def26db1fed09.zip |
iommu/amd/iommu_v2: Clear pasid state in free path
Clear pasid state in device amd_iommu_free_device() path. It will make
sure no new ppr notifier is registered in free path.
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20230609105146.7773-3-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r-- | drivers/iommu/amd/iommu_v2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/amd/iommu_v2.c b/drivers/iommu/amd/iommu_v2.c index 65d78d7e0440..c5825e0a6770 100644 --- a/drivers/iommu/amd/iommu_v2.c +++ b/drivers/iommu/amd/iommu_v2.c @@ -327,6 +327,9 @@ static void free_pasid_states(struct device_state *dev_state) put_pasid_state(pasid_state); + /* Clear the pasid state so that the pasid can be re-used */ + clear_pasid_state(dev_state, pasid_state->pasid); + /* * This will call the mn_release function and * unbind the PASID |