public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] x86-64: no_iommu removal in pci-gart.c
@ 2006-02-03  0:15 Jon Mason
  0 siblings, 0 replies; only message in thread
From: Jon Mason @ 2006-02-03  0:15 UTC (permalink / raw)
  To: ak; +Cc: mulix, linux-kernel

In previous versions of pci-gart.c, no_iommu was used to determine if IOMMU was
disabled in the GART DMA mapping functions.  This changed in 2.6.16 and now
gart_xxx() functions are only called if gart is enabled.  Therefore, uses of
no_iommu in the GART code are no longer necessary and can be removed.

Also, it removes double deceleration of no_iommu and force_iommu in pci.h and
proto.h, by removing the deceleration in pci.h.

Lastly, end_pfn off by one error.

Tested (along with patch 1/2) on dual opteron with gart enabled, iommu=soft,
and iommu=off.

Thanks,
Jon

Signed-off-by: Jon Mason <jdmason@us.ibm.com>

diff -r e961b4a72270 arch/x86_64/kernel/aperture.c
--- a/arch/x86_64/kernel/aperture.c	Thu Feb  2 21:28:35 2006
+++ b/arch/x86_64/kernel/aperture.c	Thu Feb  2 15:34:24 2006
@@ -248,7 +248,7 @@
 		/* Got the aperture from the AGP bridge */
 	} else if (swiotlb && !valid_agp) {
 		/* Do nothing */
-	} else if ((!no_iommu && end_pfn >= MAX_DMA32_PFN) ||
+	} else if ((!no_iommu && end_pfn > MAX_DMA32_PFN) ||
 		   force_iommu ||
 		   valid_agp ||
 		   fallback_aper_force) { 
diff -r e961b4a72270 arch/x86_64/kernel/pci-gart.c
--- a/arch/x86_64/kernel/pci-gart.c	Thu Feb  2 21:28:35 2006
+++ b/arch/x86_64/kernel/pci-gart.c	Thu Feb  2 15:34:24 2006
@@ -228,11 +228,6 @@
 	int mmu = high;
 	if (force_iommu) 
 		mmu = 1; 
-	if (no_iommu) { 
-		if (high) 
-			panic("PCI-DMA: high address but no IOMMU.\n"); 
-		mmu = 0; 
-	} 	
 	return mmu; 
 }
 
@@ -241,11 +236,6 @@
 	u64 mask = *dev->dma_mask;
 	int high = addr + size >= mask;
 	int mmu = high;
-	if (no_iommu) { 
-		if (high) 
-			panic("PCI-DMA: high address but no IOMMU.\n"); 
-		mmu = 0; 
-	} 	
 	return mmu; 
 }
 
@@ -631,17 +621,13 @@
 		(agp_copy_info(agp_bridge, &info) < 0);
 #endif	
 
-	if (swiotlb) { 
-		no_iommu = 1;
+	if (swiotlb)
 		return -1; 
-	} 
-	
+
 	if (no_iommu ||
 	    (!force_iommu && end_pfn <= MAX_DMA32_PFN) ||
 	    !iommu_aperture ||
 	    (no_agp && init_k8_gatt(&info) < 0)) {
-		no_iommu = 1;
-		no_iommu_init();
 		printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n");
 		if (end_pfn > MAX_DMA32_PFN) {
 			printk(KERN_ERR "WARNING more than 4GB of memory "
diff -r e961b4a72270 include/asm-x86_64/pci.h
--- a/include/asm-x86_64/pci.h	Thu Feb  2 21:28:35 2006
+++ b/include/asm-x86_64/pci.h	Thu Feb  2 15:34:24 2006
@@ -18,8 +18,6 @@
 #define pcibios_assign_all_busses()	0
 #endif
 #define pcibios_scan_all_fns(a, b)	0
-
-extern int no_iommu, force_iommu;
 
 extern unsigned long pci_mem_start;
 #define PCIBIOS_MIN_IO		0x1000

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-03  0:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-03  0:15 [PATCH 2/2] x86-64: no_iommu removal in pci-gart.c Jon Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox