Merge branches 'iommu/fixes', 'x86/amd', 'groups', 'arm/tegra' and 'api/domain-attr...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / iommu / amd_iommu_v2.c
index 036fe9bf157e0341862c8452ed47ca02b32db3c3..0d50f9afd37f97e432f66ae8123e102064088dc9 100644 (file)
@@ -81,7 +81,7 @@ struct fault {
        u16 flags;
 };
 
-struct device_state **state_table;
+static struct device_state **state_table;
 static spinlock_t state_lock;
 
 /* List and lock for all pasid_states */
@@ -681,6 +681,8 @@ int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid,
 
        atomic_set(&pasid_state->count, 1);
        init_waitqueue_head(&pasid_state->wq);
+       spin_lock_init(&pasid_state->lock);
+
        pasid_state->task         = task;
        pasid_state->mm           = get_task_mm(task);
        pasid_state->device_state = dev_state;