Skip to content

Commit

Permalink
iommu/amd: Fix hotplug with iommu=pt
Browse files Browse the repository at this point in the history
commit 2c9195e upstream.

This did not work because devices are not put into the
pt_domain. Fix this.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
[bwh: Backported to 3.2: do not use iommu_dev_data::passthrough]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
Joerg Roedel authored and bwhacks committed Aug 2, 2012
1 parent bac92b4 commit a6624e8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/iommu/amd_iommu.c
Expand Up @@ -1865,6 +1865,11 @@ static int device_change_notifier(struct notifier_block *nb,


iommu_init_device(dev); iommu_init_device(dev);


if (iommu_pass_through) {
attach_device(dev, pt_domain);
break;
}

domain = domain_for_device(dev); domain = domain_for_device(dev);


/* allocate a protection domain if a device is added */ /* allocate a protection domain if a device is added */
Expand All @@ -1880,10 +1885,7 @@ static int device_change_notifier(struct notifier_block *nb,
list_add_tail(&dma_domain->list, &iommu_pd_list); list_add_tail(&dma_domain->list, &iommu_pd_list);
spin_unlock_irqrestore(&iommu_pd_list_lock, flags); spin_unlock_irqrestore(&iommu_pd_list_lock, flags);


if (!iommu_pass_through) dev->archdata.dma_ops = &amd_iommu_dma_ops;
dev->archdata.dma_ops = &amd_iommu_dma_ops;
else
dev->archdata.dma_ops = &nommu_dma_ops;


break; break;
case BUS_NOTIFY_DEL_DEVICE: case BUS_NOTIFY_DEL_DEVICE:
Expand Down

0 comments on commit a6624e8

Please sign in to comment.