aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/aperture_64.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-04-28 17:16:33 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-05-23 12:47:19 -0400
commita5d3244a0b1c16963fd7ceadf76da843df27c3c5 (patch)
tree2bbc3a3bb1a832e4e4408fc4b45875ab69478caf /arch/x86/kernel/aperture_64.c
parentadc429d69937b3ef6fba2f8e8de9b7ce8347b662 (diff)
x86/gart: Replace printk() with pr_info()
Replace printk() with pr_info(), pr_err(), etc. Define pr_fmt() to prefix output with "AGP: ". No functional change except the addition of "AGP: " prefix in dmesg output. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'arch/x86/kernel/aperture_64.c')
-rw-r--r--arch/x86/kernel/aperture_64.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 9fa8aa051f54..b11edf2b656d 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -10,6 +10,8 @@
10 * 10 *
11 * Copyright 2002 Andi Kleen, SuSE Labs. 11 * Copyright 2002 Andi Kleen, SuSE Labs.
12 */ 12 */
13#define pr_fmt(fmt) "AGP: " fmt
14
13#include <linux/kernel.h> 15#include <linux/kernel.h>
14#include <linux/types.h> 16#include <linux/types.h>
15#include <linux/init.h> 17#include <linux/init.h>
@@ -75,14 +77,13 @@ static u32 __init allocate_aperture(void)
75 addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR, 77 addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR,
76 aper_size, aper_size); 78 aper_size, aper_size);
77 if (!addr) { 79 if (!addr) {
78 printk(KERN_ERR 80 pr_err("Cannot allocate aperture memory hole (%lx,%uK)\n",
79 "Cannot allocate aperture memory hole (%lx,%uK)\n", 81 addr, aper_size>>10);
80 addr, aper_size>>10);
81 return 0; 82 return 0;
82 } 83 }
83 memblock_reserve(addr, aper_size); 84 memblock_reserve(addr, aper_size);
84 printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", 85 pr_info("Mapping aperture over %d KB of RAM @ %lx\n", aper_size >> 10,
85 aper_size >> 10, addr); 86 addr);
86 register_nosave_region(addr >> PAGE_SHIFT, 87 register_nosave_region(addr >> PAGE_SHIFT,
87 (addr+aper_size) >> PAGE_SHIFT); 88 (addr+aper_size) >> PAGE_SHIFT);
88 89
@@ -126,10 +127,10 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
126 u64 aper; 127 u64 aper;
127 u32 old_order; 128 u32 old_order;
128 129
129 printk(KERN_INFO "AGP bridge at %02x:%02x:%02x\n", bus, slot, func); 130 pr_info("AGP bridge at %02x:%02x:%02x\n", bus, slot, func);
130 apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14); 131 apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14);
131 if (apsizereg == 0xffffffff) { 132 if (apsizereg == 0xffffffff) {
132 printk(KERN_ERR "APSIZE in AGP bridge unreadable\n"); 133 pr_err("APSIZE in AGP bridge unreadable\n");
133 return 0; 134 return 0;
134 } 135 }
135 136
@@ -153,16 +154,16 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
153 * On some sick chips, APSIZE is 0. It means it wants 4G 154 * On some sick chips, APSIZE is 0. It means it wants 4G
154 * so let double check that order, and lets trust AMD NB settings: 155 * so let double check that order, and lets trust AMD NB settings:
155 */ 156 */
156 printk(KERN_INFO "Aperture from AGP @ %Lx old size %u MB\n", 157 pr_info("Aperture from AGP @ %Lx old size %u MB\n",
157 aper, 32 << old_order); 158 aper, 32 << old_order);
158 if (aper + (32ULL<<(20 + *order)) > 0x100000000ULL) { 159 if (aper + (32ULL<<(20 + *order)) > 0x100000000ULL) {
159 printk(KERN_INFO "Aperture size %u MB (APSIZE %x) is not right, using settings from NB\n", 160 pr_info("Aperture size %u MB (APSIZE %x) is not right, using settings from NB\n",
160 32 << *order, apsizereg); 161 32 << *order, apsizereg);
161 *order = old_order; 162 *order = old_order;
162 } 163 }
163 164
164 printk(KERN_INFO "Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n", 165 pr_info("Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n", aper,
165 aper, 32 << *order, apsizereg); 166 32 << *order, apsizereg);
166 167
167 if (!aperture_valid(aper, (32*1024*1024) << *order, 32<<20)) 168 if (!aperture_valid(aper, (32*1024*1024) << *order, 32<<20))
168 return 0; 169 return 0;
@@ -218,7 +219,7 @@ static u32 __init search_agp_bridge(u32 *order, int *valid_agp)
218 } 219 }
219 } 220 }
220 } 221 }
221 printk(KERN_INFO "No AGP bridge found\n"); 222 pr_info("No AGP bridge found\n");
222 223
223 return 0; 224 return 0;
224} 225}
@@ -310,7 +311,7 @@ void __init early_gart_iommu_check(void)
310 if (e820_any_mapped(aper_base, aper_base + aper_size, 311 if (e820_any_mapped(aper_base, aper_base + aper_size,
311 E820_RAM)) { 312 E820_RAM)) {
312 /* reserve it, so we can reuse it in second kernel */ 313 /* reserve it, so we can reuse it in second kernel */
313 printk(KERN_INFO "update e820 for GART\n"); 314 pr_info("update e820 for GART\n");
314 e820_add_region(aper_base, aper_size, E820_RESERVED); 315 e820_add_region(aper_base, aper_size, E820_RESERVED);
315 update_e820(); 316 update_e820();
316 } 317 }
@@ -354,7 +355,7 @@ int __init gart_iommu_hole_init(void)
354 !early_pci_allowed()) 355 !early_pci_allowed())
355 return -ENODEV; 356 return -ENODEV;
356 357
357 printk(KERN_INFO "Checking aperture...\n"); 358 pr_info("Checking aperture...\n");
358 359
359 if (!fallback_aper_force) 360 if (!fallback_aper_force)
360 agp_aper_base = search_agp_bridge(&agp_aper_order, &valid_agp); 361 agp_aper_base = search_agp_bridge(&agp_aper_order, &valid_agp);
@@ -395,8 +396,8 @@ int __init gart_iommu_hole_init(void)
395 aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff; 396 aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff;
396 aper_base <<= 25; 397 aper_base <<= 25;
397 398
398 printk(KERN_INFO "Node %d: aperture @ %Lx size %u MB\n", 399 pr_info("Node %d: aperture @ %Lx size %u MB\n",
399 node, aper_base, aper_size >> 20); 400 node, aper_base, aper_size >> 20);
400 node++; 401 node++;
401 402
402 if (!aperture_valid(aper_base, aper_size, 64<<20)) { 403 if (!aperture_valid(aper_base, aper_size, 64<<20)) {
@@ -407,9 +408,9 @@ int __init gart_iommu_hole_init(void)
407 if (!no_iommu && 408 if (!no_iommu &&
408 max_pfn > MAX_DMA32_PFN && 409 max_pfn > MAX_DMA32_PFN &&
409 !printed_gart_size_msg) { 410 !printed_gart_size_msg) {
410 printk(KERN_ERR "you are using iommu with agp, but GART size is less than 64M\n"); 411 pr_err("you are using iommu with agp, but GART size is less than 64M\n");
411 printk(KERN_ERR "please increase GART size in your BIOS setup\n"); 412 pr_err("please increase GART size in your BIOS setup\n");
412 printk(KERN_ERR "if BIOS doesn't have that option, contact your HW vendor!\n"); 413 pr_err("if BIOS doesn't have that option, contact your HW vendor!\n");
413 printed_gart_size_msg = 1; 414 printed_gart_size_msg = 1;
414 } 415 }
415 } else { 416 } else {
@@ -446,13 +447,10 @@ out:
446 force_iommu || 447 force_iommu ||
447 valid_agp || 448 valid_agp ||
448 fallback_aper_force) { 449 fallback_aper_force) {
449 printk(KERN_INFO 450 pr_info("Your BIOS doesn't leave a aperture memory hole\n");
450 "Your BIOS doesn't leave a aperture memory hole\n"); 451 pr_info("Please enable the IOMMU option in the BIOS setup\n");
451 printk(KERN_INFO 452 pr_info("This costs you %d MB of RAM\n",
452 "Please enable the IOMMU option in the BIOS setup\n"); 453 32 << fallback_aper_order);
453 printk(KERN_INFO
454 "This costs you %d MB of RAM\n",
455 32 << fallback_aper_order);
456 454
457 aper_order = fallback_aper_order; 455 aper_order = fallback_aper_order;
458 aper_alloc = allocate_aperture(); 456 aper_alloc = allocate_aperture();