Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245386
b: refs/heads/master
c: d8c1308
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel committed Apr 7, 2011
1 parent 6d00949 commit ca55c97
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 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: ac0ea6e92b2227c86fe4f7f9eb429071d617a25d
refs/heads/master: d8c13085775c72e2d46edc54ed0c803c3a944ddb
26 changes: 16 additions & 10 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,21 +530,27 @@ static int iommu_completion_wait(struct amd_iommu *iommu)
return wait_on_sem(&sem);
}

static int iommu_flush_dte(struct amd_iommu *iommu, u16 devid)
{
struct iommu_cmd cmd;

build_inv_dte(&cmd, devid);

return iommu_queue_command(iommu, &cmd);
}

/*
* Command send function for invalidating a device table entry
*/
static int iommu_flush_device(struct device *dev)
static int device_flush_dte(struct device *dev)
{
struct amd_iommu *iommu;
struct iommu_cmd cmd;
u16 devid;

devid = get_device_id(dev);
iommu = amd_iommu_rlookup_table[devid];

build_inv_dte(&cmd, devid);

return iommu_queue_command(iommu, &cmd);
return iommu_flush_dte(iommu, devid);
}

/*
Expand Down Expand Up @@ -620,7 +626,7 @@ static void domain_flush_devices(struct protection_domain *domain)
spin_lock_irqsave(&domain->lock, flags);

list_for_each_entry(dev_data, &domain->dev_list, list)
iommu_flush_device(dev_data->dev);
device_flush_dte(dev_data->dev);

spin_unlock_irqrestore(&domain->lock, flags);
}
Expand Down Expand Up @@ -1424,7 +1430,7 @@ static void do_attach(struct device *dev, struct protection_domain *domain)
domain->dev_cnt += 1;

/* Flush the DTE entry */
iommu_flush_device(dev);
device_flush_dte(dev);
}

static void do_detach(struct device *dev)
Expand All @@ -1447,7 +1453,7 @@ static void do_detach(struct device *dev)
clear_dte_entry(devid);

/* Flush the DTE entry */
iommu_flush_device(dev);
device_flush_dte(dev);
}

/*
Expand Down Expand Up @@ -1663,7 +1669,7 @@ static int device_change_notifier(struct notifier_block *nb,
goto out;
}

iommu_flush_device(dev);
device_flush_dte(dev);
iommu_completion_wait(iommu);

out:
Expand Down Expand Up @@ -2448,7 +2454,7 @@ static void amd_iommu_detach_device(struct iommu_domain *dom,
if (!iommu)
return;

iommu_flush_device(dev);
device_flush_dte(dev);
iommu_completion_wait(iommu);
}

Expand Down

0 comments on commit ca55c97

Please sign in to comment.