Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245379
b: refs/heads/master
c: ded4673
h: refs/heads/master
i:
  245377: bd14da1
  245375: c537cee
v: v3
  • Loading branch information
Joerg Roedel committed Apr 6, 2011
1 parent dee6aa6 commit ed7c626
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 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: ba4b87ad5497cba555954885db99c99627f93748
refs/heads/master: ded467374a34eb80020c2213456b1d9ca946b88c
11 changes: 8 additions & 3 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,13 @@ irqreturn_t amd_iommu_int_handler(int irq, void *data)
*
****************************************************************************/

static void build_completion_wait(struct iommu_cmd *cmd)
{
memset(cmd, 0, sizeof(*cmd));
cmd->data[0] = CMD_COMPL_WAIT_INT_MASK;
CMD_SET_TYPE(cmd, CMD_COMPL_WAIT);
}

/*
* Writes the command to the IOMMUs command buffer and informs the
* hardware about the new command. Must be called with iommu->lock held.
Expand Down Expand Up @@ -458,9 +465,7 @@ static int __iommu_completion_wait(struct amd_iommu *iommu)
{
struct iommu_cmd cmd;

memset(&cmd, 0, sizeof(cmd));
cmd.data[0] = CMD_COMPL_WAIT_INT_MASK;
CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT);
build_completion_wait(&cmd);

return __iommu_queue_command(iommu, &cmd);
}
Expand Down
18 changes: 5 additions & 13 deletions trunk/lib/dma-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ static int dma_debug_fs_init(void)
return -ENOMEM;
}

static int device_dma_allocations(struct device *dev, struct dma_debug_entry **out_entry)
static int device_dma_allocations(struct device *dev)
{
struct dma_debug_entry *entry;
unsigned long flags;
Expand All @@ -660,10 +660,8 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **o
for (i = 0; i < HASH_SIZE; ++i) {
spin_lock(&dma_entry_hash[i].lock);
list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
if (entry->dev == dev) {
if (entry->dev == dev)
count += 1;
*out_entry = entry;
}
}
spin_unlock(&dma_entry_hash[i].lock);
}
Expand All @@ -676,25 +674,19 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **o
static int dma_debug_device_change(struct notifier_block *nb, unsigned long action, void *data)
{
struct device *dev = data;
struct dma_debug_entry *uninitialized_var(entry);
int count;

if (global_disable)
return 0;

switch (action) {
case BUS_NOTIFY_UNBOUND_DRIVER:
count = device_dma_allocations(dev, &entry);
count = device_dma_allocations(dev);
if (count == 0)
break;
err_printk(dev, entry, "DMA-API: device driver has pending "
err_printk(dev, NULL, "DMA-API: device driver has pending "
"DMA allocations while released from device "
"[count=%d]\n"
"One of leaked entries details: "
"[device address=0x%016llx] [size=%llu bytes] "
"[mapped with %s] [mapped as %s]\n",
count, entry->dev_addr, entry->size,
dir2name[entry->direction], type2name[entry->type]);
"[count=%d]\n", count);
break;
default:
break;
Expand Down

0 comments on commit ed7c626

Please sign in to comment.