From 44193e9c1ba7f5497dd1617393b0b71cfec03099 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Sat, 8 Nov 2003 16:55:36 -0800 Subject: [PATCH] [PATCH] Fix critical issue in x86-64 IOMMU code The K8 IOMMU code had some broken BUG_ON()s that hit with <4K aligned IO through the IOMMU. This patch fixes this. Without this database raw IO is often broken. --- arch/x86_64/kernel/pci-gart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index abbcf58f4fb5a..2e367f9c83bee 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c @@ -395,7 +395,7 @@ static int __pci_map_cont(struct scatterlist *sg, int start, int stopat, for (i = start; i < stopat; i++) { struct scatterlist *s = &sg[i]; unsigned long start_addr = s->dma_address; - BUG_ON(i > 0 && s->offset); + BUG_ON(i > start && s->offset); if (i == start) { *sout = *s; sout->dma_address = iommu_bus_base; @@ -410,7 +410,6 @@ static int __pci_map_cont(struct scatterlist *sg, int start, int stopat, addr += PAGE_SIZE; iommu_page++; } - BUG_ON(i > 0 && addr % PAGE_SIZE); } BUG_ON(iommu_page - iommu_start != pages); return 0; -- 2.53.0