Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125621
b: refs/heads/master
c: 1ac4cbb
h: refs/heads/master
i:
  125619: d8ae37b
v: v3
  • Loading branch information
Joerg Roedel committed Jan 3, 2009
1 parent 593e524 commit 4301a81
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2dc14a2a6c9a83baaafc51f06b7e73cec2167be
refs/heads/master: 1ac4cbbc5eb56de96d264d10f464ba5222815b1b
17 changes: 17 additions & 0 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@ static int device_change_notifier(struct notifier_block *nb,
struct protection_domain *domain;
struct dma_ops_domain *dma_domain;
struct amd_iommu *iommu;
int order = amd_iommu_aperture_order;
unsigned long flags;

if (devid > amd_iommu_last_bdf)
goto out;
Expand Down Expand Up @@ -954,6 +956,21 @@ static int device_change_notifier(struct notifier_block *nb,
if (!domain)
goto out;
detach_device(domain, devid);
break;
case BUS_NOTIFY_ADD_DEVICE:
/* allocate a protection domain if a device is added */
dma_domain = find_protection_domain(devid);
if (dma_domain)
goto out;
dma_domain = dma_ops_domain_alloc(iommu, order);
if (!dma_domain)
goto out;
dma_domain->target_dev = devid;

spin_lock_irqsave(&iommu_pd_list_lock, flags);
list_add_tail(&dma_domain->list, &iommu_pd_list);
spin_unlock_irqrestore(&iommu_pd_list_lock, flags);

break;
default:
goto out;
Expand Down

0 comments on commit 4301a81

Please sign in to comment.