aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2007-10-26 07:56:24 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-10-29 04:18:03 -0400
commit5336940dd8b11180a0340ba886db62f728377d19 (patch)
treeb382a134c814c6067adecc6522a2b90092ab5b03 /arch/x86/kernel
parent9335432959111c982c74177521305e6a3fb600a3 (diff)
x86: fix pci-gart failure handling
blk_rq_map_sg doesn't initialize sg->dma_address/length to zero anymore. Some low level drivers reuse sg lists without initializing so IOMMUs might get non-zero dma_address/length. If map_sg fails, we need pass the number of the mapped entries to gart_unmap_sg. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/pci-gart_64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index ae7e0161ce46..79b514b381b1 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -435,7 +435,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
435 435
436error: 436error:
437 flush_gart(); 437 flush_gart();
438 gart_unmap_sg(dev, sg, nents, dir); 438 gart_unmap_sg(dev, sg, out, dir);
439 /* When it was forced or merged try again in a dumb way */ 439 /* When it was forced or merged try again in a dumb way */
440 if (force_iommu || iommu_merge) { 440 if (force_iommu || iommu_merge) {
441 out = dma_map_sg_nonforce(dev, sg, nents, dir); 441 out = dma_map_sg_nonforce(dev, sg, nents, dir);