diff options
author | Joerg Roedel <jroedel@suse.de> | 2014-08-05 10:48:10 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2014-08-26 05:37:42 -0400 |
commit | f251e187f2949c690fc13a91df7b873a6b5be671 (patch) | |
tree | 66f9b0e5f7cb1633791cef7426bc505c6e50d1a2 | |
parent | 50917e265ebd2ea33bc34b22b3981f1e88415eae (diff) |
iommu/amd: Keep a list of devices in an alias group
Some broken devices might use any request-id from the alias
group, so we need to set a DTE entry for every device in
there. This patch adds creation of those lists.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r-- | drivers/iommu/amd_iommu.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index fe6d7cc715f7..8a152564a098 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -93,6 +93,7 @@ static struct dma_map_ops amd_iommu_dma_ops; | |||
93 | struct iommu_dev_data { | 93 | struct iommu_dev_data { |
94 | struct list_head list; /* For domain->dev_list */ | 94 | struct list_head list; /* For domain->dev_list */ |
95 | struct list_head dev_data_list; /* For global dev_data_list */ | 95 | struct list_head dev_data_list; /* For global dev_data_list */ |
96 | struct list_head alias_list; /* Link alias-groups together */ | ||
96 | struct iommu_dev_data *alias_data;/* The alias dev_data */ | 97 | struct iommu_dev_data *alias_data;/* The alias dev_data */ |
97 | struct protection_domain *domain; /* Domain the device is bound to */ | 98 | struct protection_domain *domain; /* Domain the device is bound to */ |
98 | atomic_t bind; /* Domain attach reference count */ | 99 | atomic_t bind; /* Domain attach reference count */ |
@@ -135,6 +136,8 @@ static struct iommu_dev_data *alloc_dev_data(u16 devid) | |||
135 | if (!dev_data) | 136 | if (!dev_data) |
136 | return NULL; | 137 | return NULL; |
137 | 138 | ||
139 | INIT_LIST_HEAD(&dev_data->alias_list); | ||
140 | |||
138 | dev_data->devid = devid; | 141 | dev_data->devid = devid; |
139 | atomic_set(&dev_data->bind, 0); | 142 | atomic_set(&dev_data->bind, 0); |
140 | 143 | ||
@@ -383,6 +386,9 @@ static int iommu_init_device(struct device *dev) | |||
383 | return -ENOTSUPP; | 386 | return -ENOTSUPP; |
384 | } | 387 | } |
385 | dev_data->alias_data = alias_data; | 388 | dev_data->alias_data = alias_data; |
389 | |||
390 | /* Add device to the alias_list */ | ||
391 | list_add(&dev_data->alias_list, &alias_data->alias_list); | ||
386 | } | 392 | } |
387 | 393 | ||
388 | ret = init_iommu_group(dev); | 394 | ret = init_iommu_group(dev); |