diff options
| author | Vasant Hegde <[email protected]> | 2024-02-05 11:56:07 +0000 |
|---|---|---|
| committer | Joerg Roedel <[email protected]> | 2024-02-09 13:16:26 +0100 |
| commit | bf8aff2945ba4091f503df673b9df33002546e6a (patch) | |
| tree | cbaeb7324c602f203e6696778b08d72cc0ba8021 /include/linux | |
| parent | b2e8a7f5d2c3d99285e13cdd330d339d9b040599 (diff) | |
iommu: Introduce iommu_group_mutex_assert()
Add function to check iommu group mutex lock. So that device drivers can
rely on group mutex lock instead of adding another driver level lock
before modifying driver specific device data structure.
Suggested-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Vasant Hegde <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/iommu.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 32bb121e8032..8141a37556d5 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1356,6 +1356,14 @@ static inline ioasid_t iommu_alloc_global_pasid(struct device *dev) static inline void iommu_free_global_pasid(ioasid_t pasid) {} #endif /* CONFIG_IOMMU_API */ +#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_IOMMU_API) +void iommu_group_mutex_assert(struct device *dev); +#else +static inline void iommu_group_mutex_assert(struct device *dev) +{ +} +#endif + /** * iommu_map_sgtable - Map the given buffer to the IOMMU domain * @domain: The IOMMU domain to perform the mapping |