File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1248,6 +1248,25 @@ void iommu_group_remove_device(struct device *dev)
1248
1248
}
1249
1249
EXPORT_SYMBOL_GPL (iommu_group_remove_device );
1250
1250
1251
+ #if IS_ENABLED (CONFIG_LOCKDEP ) && IS_ENABLED (CONFIG_IOMMU_API )
1252
+ /**
1253
+ * iommu_group_mutex_assert - Check device group mutex lock
1254
+ * @dev: the device that has group param set
1255
+ *
1256
+ * This function is called by an iommu driver to check whether it holds
1257
+ * group mutex lock for the given device or not.
1258
+ *
1259
+ * Note that this function must be called after device group param is set.
1260
+ */
1261
+ void iommu_group_mutex_assert (struct device * dev )
1262
+ {
1263
+ struct iommu_group * group = dev -> iommu_group ;
1264
+
1265
+ lockdep_assert_held (& group -> mutex );
1266
+ }
1267
+ EXPORT_SYMBOL_GPL (iommu_group_mutex_assert );
1268
+ #endif
1269
+
1251
1270
static struct device * iommu_group_first_dev (struct iommu_group * group )
1252
1271
{
1253
1272
lockdep_assert_held (& group -> mutex );
Original file line number Diff line number Diff line change @@ -1356,6 +1356,14 @@ static inline ioasid_t iommu_alloc_global_pasid(struct device *dev)
1356
1356
static inline void iommu_free_global_pasid (ioasid_t pasid ) {}
1357
1357
#endif /* CONFIG_IOMMU_API */
1358
1358
1359
+ #if IS_ENABLED (CONFIG_LOCKDEP ) && IS_ENABLED (CONFIG_IOMMU_API )
1360
+ void iommu_group_mutex_assert (struct device * dev );
1361
+ #else
1362
+ static inline void iommu_group_mutex_assert (struct device * dev )
1363
+ {
1364
+ }
1365
+ #endif
1366
+
1359
1367
/**
1360
1368
* iommu_map_sgtable - Map the given buffer to the IOMMU domain
1361
1369
* @domain: The IOMMU domain to perform the mapping
You can’t perform that action at this time.
0 commit comments