Skip to content

Commit

Permalink
iommu/amd: Keep a list of devices in an alias group
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel committed Aug 26, 2014
1 parent 50917e2 commit f251e18
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ static struct dma_map_ops amd_iommu_dma_ops;
struct iommu_dev_data {
struct list_head list; /* For domain->dev_list */
struct list_head dev_data_list; /* For global dev_data_list */
struct list_head alias_list; /* Link alias-groups together */
struct iommu_dev_data *alias_data;/* The alias dev_data */
struct protection_domain *domain; /* Domain the device is bound to */
atomic_t bind; /* Domain attach reference count */
Expand Down Expand Up @@ -135,6 +136,8 @@ static struct iommu_dev_data *alloc_dev_data(u16 devid)
if (!dev_data)
return NULL;

INIT_LIST_HEAD(&dev_data->alias_list);

dev_data->devid = devid;
atomic_set(&dev_data->bind, 0);

Expand Down Expand Up @@ -383,6 +386,9 @@ static int iommu_init_device(struct device *dev)
return -ENOTSUPP;
}
dev_data->alias_data = alias_data;

/* Add device to the alias_list */
list_add(&dev_data->alias_list, &alias_data->alias_list);
}

ret = init_iommu_group(dev);
Expand Down

0 comments on commit f251e18

Please sign in to comment.