iommu/amd: Lock dev_data in attach/detach code paths
[sfrench/cifs-2.6.git] / drivers / iommu / amd_iommu_types.h
index 0186501ab9717b624643a402a95f079e39d4decb..c9c1612d52e00090a2fb1a4e374e9468ba25607e 100644 (file)
@@ -633,6 +633,9 @@ struct devid_map {
  * This struct contains device specific data for the IOMMU
  */
 struct iommu_dev_data {
+       /*Protect against attach/detach races */
+       spinlock_t lock;
+
        struct list_head list;            /* For domain->dev_list */
        struct llist_node dev_data_list;  /* For global dev_data_list */
        struct protection_domain *domain; /* Domain the device is bound to */