Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316567
b: refs/heads/master
c: 2c9195e
h: refs/heads/master
i:
  316565: 8894d3b
  316563: 2022561
  316559: b02d816
v: v3
  • Loading branch information
Joerg Roedel committed Jul 19, 2012
1 parent dead5c0 commit f5ac893
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c13d47a1a7ee8808796016c617aef25fd1d1925
refs/heads/master: 2c9195e990297068d0f1f1bd8e2f1d09538009da
17 changes: 13 additions & 4 deletions trunk/drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2254,6 +2254,18 @@ static int device_change_notifier(struct notifier_block *nb,

iommu_init_device(dev);

/*
* dev_data is still NULL and
* got initialized in iommu_init_device
*/
dev_data = get_dev_data(dev);

if (iommu_pass_through || dev_data->iommu_v2) {
dev_data->passthrough = true;
attach_device(dev, pt_domain);
break;
}

domain = domain_for_device(dev);

/* allocate a protection domain if a device is added */
Expand All @@ -2271,10 +2283,7 @@ static int device_change_notifier(struct notifier_block *nb,

dev_data = get_dev_data(dev);

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

break;
case BUS_NOTIFY_DEL_DEVICE:
Expand Down

0 comments on commit f5ac893

Please sign in to comment.