Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112593
b: refs/heads/master
c: 270cab2
h: refs/heads/master
i:
  112591: dc1742f
v: v3
  • Loading branch information
Joerg Roedel authored and Ingo Molnar committed Sep 19, 2008
1 parent 3bc3dab commit 7894b21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 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: dbcc112e3b5367e81a845b082933506b0ff1d1e2
refs/heads/master: 270cab2426cdc6307725e4f1f46ecf8ab8e69193
19 changes: 5 additions & 14 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,9 @@ static dma_addr_t __map_single(struct device *dev,
}
address += offset;

if (unlikely(iommu_has_npcache(iommu)))
iommu_flush_pages(iommu, dma_dom->domain.id, address, size);

out:
return address;
}
Expand Down Expand Up @@ -825,6 +828,8 @@ static void __unmap_single(struct amd_iommu *iommu,
}

dma_ops_free_addresses(dma_dom, dma_addr, pages);

iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size);
}

/*
Expand Down Expand Up @@ -853,9 +858,6 @@ static dma_addr_t map_single(struct device *dev, phys_addr_t paddr,
if (addr == bad_dma_address)
goto out;

if (iommu_has_npcache(iommu))
iommu_flush_pages(iommu, domain->id, addr, size);

if (iommu->need_sync)
iommu_completion_wait(iommu);

Expand Down Expand Up @@ -885,8 +887,6 @@ static void unmap_single(struct device *dev, dma_addr_t dma_addr,

__unmap_single(iommu, domain->priv, dma_addr, size, dir);

iommu_flush_pages(iommu, domain->id, dma_addr, size);

if (iommu->need_sync)
iommu_completion_wait(iommu);

Expand Down Expand Up @@ -948,9 +948,6 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
mapped_elems++;
} else
goto unmap;
if (iommu_has_npcache(iommu))
iommu_flush_pages(iommu, domain->id, s->dma_address,
s->dma_length);
}

if (iommu->need_sync)
Expand Down Expand Up @@ -996,8 +993,6 @@ static void unmap_sg(struct device *dev, struct scatterlist *sglist,
for_each_sg(sglist, s, nelems, i) {
__unmap_single(iommu, domain->priv, s->dma_address,
s->dma_length, dir);
iommu_flush_pages(iommu, domain->id, s->dma_address,
s->dma_length);
s->dma_address = s->dma_length = 0;
}

Expand Down Expand Up @@ -1048,9 +1043,6 @@ static void *alloc_coherent(struct device *dev, size_t size,
goto out;
}

if (iommu_has_npcache(iommu))
iommu_flush_pages(iommu, domain->id, *dma_addr, size);

if (iommu->need_sync)
iommu_completion_wait(iommu);

Expand Down Expand Up @@ -1082,7 +1074,6 @@ static void free_coherent(struct device *dev, size_t size,
spin_lock_irqsave(&domain->lock, flags);

__unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL);
iommu_flush_pages(iommu, domain->id, dma_addr, size);

if (iommu->need_sync)
iommu_completion_wait(iommu);
Expand Down

0 comments on commit 7894b21

Please sign in to comment.