Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b7b644c authored by Jon Mason's avatar Jon Mason Committed by Linus Torvalds
Browse files

[PATCH] x86_64: IOMMU printk cleanup



This patch contains a printk reorder to remove the current problem of
displaying "PCI-DMA: Disabling IOMMU." and then "PCI-DMA: using GART
IOMMU" 20 lines later in dmesg.

It also constains a printk reorder in swiotlb to state swiotlb
enablement prior to describing the location of the bounce buffers, and a
printk reorder to state gart enablement prior to describing the
aperature.

Also constains a whitespace cleanup in arch/x86_64/kernel/setup.c

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

Signed-off-by: default avatarJon Mason <jdmason@us.ibm.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 14c3f855
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -645,9 +645,18 @@ static int __init pci_iommu_init(void)
	    (no_agp && init_k8_gatt(&info) < 0)) {
	    (no_agp && init_k8_gatt(&info) < 0)) {
		no_iommu = 1;
		no_iommu = 1;
		no_iommu_init();
		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 "
					"but IOMMU not compiled in.\n"
			       KERN_ERR "WARNING 32bit PCI may malfunction.\n"
			       KERN_ERR "You might want to enable "
					"CONFIG_GART_IOMMU\n");
		}
		return -1;
		return -1;
	}
	}


	printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n");
	aper_size = info.aper_size * 1024 * 1024;	
	aper_size = info.aper_size * 1024 * 1024;	
	iommu_size = check_iommu_size(info.aper_base, aper_size); 
	iommu_size = check_iommu_size(info.aper_base, aper_size); 
	iommu_pages = iommu_size >> PAGE_SHIFT; 
	iommu_pages = iommu_size >> PAGE_SHIFT; 
@@ -721,7 +730,6 @@ static int __init pci_iommu_init(void)
		     
		     
	flush_gart(NULL);
	flush_gart(NULL);


	printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n");
	dma_ops = &gart_dma_ops;
	dma_ops = &gart_dma_ops;


	return 0;
	return 0;
+0 −7
Original line number Original line Diff line number Diff line
@@ -88,12 +88,5 @@ void __init no_iommu_init(void)
{
{
	if (dma_ops)
	if (dma_ops)
		return;
		return;
	printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n");
	dma_ops = &nommu_dma_ops;
	dma_ops = &nommu_dma_ops;
	if (end_pfn > MAX_DMA32_PFN) {
		printk(KERN_ERR
		       "WARNING more than 4GB of memory but IOMMU not compiled in.\n"
		       KERN_ERR "WARNING 32bit PCI may malfunction.\n"
		       KERN_ERR "You might want to enable CONFIG_GART_IOMMU\n");
	}
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -35,8 +35,8 @@ void pci_swiotlb_init(void)
	    (end_pfn > MAX_DMA32_PFN || force_iommu))
	    (end_pfn > MAX_DMA32_PFN || force_iommu))
	       swiotlb = 1;
	       swiotlb = 1;
	if (swiotlb) {
	if (swiotlb) {
		swiotlb_init();
		printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
		printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
		swiotlb_init();
		dma_ops = &swiotlb_dma_ops;
		dma_ops = &swiotlb_dma_ops;
	}
	}
}
}
+1 −1

File changed.

Contains only whitespace changes.