diff options
-rw-r--r-- | arch/x86_64/kernel/pci-gart.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index c37fc7726ba6..9188b25fad2a 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c | |||
@@ -457,9 +457,12 @@ int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir) | |||
457 | error: | 457 | error: |
458 | flush_gart(NULL); | 458 | flush_gart(NULL); |
459 | gart_unmap_sg(dev, sg, nents, dir); | 459 | gart_unmap_sg(dev, sg, nents, dir); |
460 | /* When it was forced try again unforced */ | 460 | /* When it was forced or merged try again in a dumb way */ |
461 | if (force_iommu) | 461 | if (force_iommu || iommu_merge) { |
462 | return dma_map_sg_nonforce(dev, sg, nents, dir); | 462 | out = dma_map_sg_nonforce(dev, sg, nents, dir); |
463 | if (out > 0) | ||
464 | return out; | ||
465 | } | ||
463 | if (panic_on_overflow) | 466 | if (panic_on_overflow) |
464 | panic("dma_map_sg: overflow on %lu pages\n", pages); | 467 | panic("dma_map_sg: overflow on %lu pages\n", pages); |
465 | iommu_full(dev, pages << PAGE_SHIFT, dir); | 468 | iommu_full(dev, pages << PAGE_SHIFT, dir); |