aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2018-05-10 11:45:31 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-05-13 15:25:18 -0400
commite6d8c84a58380030457759ad6085f3792a76b2ce (patch)
treeb4903416456c3a8dcfc1625aeddea14eec81a72e
parent1de392f5d5e803663abbd8ed084233f154152bcd (diff)
x86/mtrr: Rename main.c to mtrr.c and remove duplicate prefixes
Kbuild uses the first file as the name for KBUILD_MODNAME. mtrr uses main.c as its first file, so rename that file to mtrr.c and fixup the Makefile. Remove the now duplicate "mtrr: " prefixes from the logging calls. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Link: https://lkml.kernel.org/r/ae1fa81a0d1fad87571967b91ea90f70f486e853.1525964384.git.joe@perches.com
-rw-r--r--arch/x86/kernel/cpu/mtrr/Makefile2
-rw-r--r--arch/x86/kernel/cpu/mtrr/mtrr.c (renamed from arch/x86/kernel/cpu/mtrr/main.c)33
2 files changed, 17 insertions, 18 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/Makefile b/arch/x86/kernel/cpu/mtrr/Makefile
index ad9e5ed81181..2ad9107ee980 100644
--- a/arch/x86/kernel/cpu/mtrr/Makefile
+++ b/arch/x86/kernel/cpu/mtrr/Makefile
@@ -1,3 +1,3 @@
1obj-y := main.o if.o generic.o cleanup.o 1obj-y := mtrr.o if.o generic.o cleanup.o
2obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o 2obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
3 3
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/mtrr.c
index 7468de429087..0c4f4fba9ec1 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/mtrr.c
@@ -100,7 +100,7 @@ static int have_wrcomb(void)
100 if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS && 100 if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
101 dev->device == PCI_DEVICE_ID_SERVERWORKS_LE && 101 dev->device == PCI_DEVICE_ID_SERVERWORKS_LE &&
102 dev->revision <= 5) { 102 dev->revision <= 5) {
103 pr_info("mtrr: Serverworks LE rev < 6 detected. Write-combining disabled.\n"); 103 pr_info("Serverworks LE rev < 6 detected. Write-combining disabled.\n");
104 pci_dev_put(dev); 104 pci_dev_put(dev);
105 return 0; 105 return 0;
106 } 106 }
@@ -110,7 +110,7 @@ static int have_wrcomb(void)
110 */ 110 */
111 if (dev->vendor == PCI_VENDOR_ID_INTEL && 111 if (dev->vendor == PCI_VENDOR_ID_INTEL &&
112 dev->device == PCI_DEVICE_ID_INTEL_82451NX) { 112 dev->device == PCI_DEVICE_ID_INTEL_82451NX) {
113 pr_info("mtrr: Intel 450NX MMC detected. Write-combining disabled.\n"); 113 pr_info("Intel 450NX MMC detected. Write-combining disabled.\n");
114 pci_dev_put(dev); 114 pci_dev_put(dev);
115 return 0; 115 return 0;
116 } 116 }
@@ -312,24 +312,24 @@ int mtrr_add_page(unsigned long base, unsigned long size,
312 return error; 312 return error;
313 313
314 if (type >= MTRR_NUM_TYPES) { 314 if (type >= MTRR_NUM_TYPES) {
315 pr_warn("mtrr: type: %u invalid\n", type); 315 pr_warn("type: %u invalid\n", type);
316 return -EINVAL; 316 return -EINVAL;
317 } 317 }
318 318
319 /* If the type is WC, check that this processor supports it */ 319 /* If the type is WC, check that this processor supports it */
320 if ((type == MTRR_TYPE_WRCOMB) && !have_wrcomb()) { 320 if ((type == MTRR_TYPE_WRCOMB) && !have_wrcomb()) {
321 pr_warn("mtrr: your processor doesn't support write-combining\n"); 321 pr_warn("your processor doesn't support write-combining\n");
322 return -ENOSYS; 322 return -ENOSYS;
323 } 323 }
324 324
325 if (!size) { 325 if (!size) {
326 pr_warn("mtrr: zero sized request\n"); 326 pr_warn("zero sized request\n");
327 return -EINVAL; 327 return -EINVAL;
328 } 328 }
329 329
330 if ((base | (base + size - 1)) >> 330 if ((base | (base + size - 1)) >>
331 (boot_cpu_data.x86_phys_bits - PAGE_SHIFT)) { 331 (boot_cpu_data.x86_phys_bits - PAGE_SHIFT)) {
332 pr_warn("mtrr: base or size exceeds the MTRR width\n"); 332 pr_warn("base or size exceeds the MTRR width\n");
333 return -EINVAL; 333 return -EINVAL;
334 } 334 }
335 335
@@ -360,8 +360,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
360 } else if (types_compatible(type, ltype)) 360 } else if (types_compatible(type, ltype))
361 continue; 361 continue;
362 } 362 }
363 pr_warn("mtrr: 0x%lx000,0x%lx000 overlaps existing" 363 pr_warn("0x%lx000,0x%lx000 overlaps existing 0x%lx000,0x%lx000\n", base, size, lbase,
364 " 0x%lx000,0x%lx000\n", base, size, lbase,
365 lsize); 364 lsize);
366 goto out; 365 goto out;
367 } 366 }
@@ -369,7 +368,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
369 if (ltype != type) { 368 if (ltype != type) {
370 if (types_compatible(type, ltype)) 369 if (types_compatible(type, ltype))
371 continue; 370 continue;
372 pr_warn("mtrr: type mismatch for %lx000,%lx000 old: %s new: %s\n", 371 pr_warn("type mismatch for %lx000,%lx000 old: %s new: %s\n",
373 base, size, mtrr_attrib_to_str(ltype), 372 base, size, mtrr_attrib_to_str(ltype),
374 mtrr_attrib_to_str(type)); 373 mtrr_attrib_to_str(type));
375 goto out; 374 goto out;
@@ -395,7 +394,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
395 } 394 }
396 } 395 }
397 } else { 396 } else {
398 pr_info("mtrr: no more MTRRs available\n"); 397 pr_info("no more MTRRs available\n");
399 } 398 }
400 error = i; 399 error = i;
401 out: 400 out:
@@ -407,8 +406,8 @@ int mtrr_add_page(unsigned long base, unsigned long size,
407static int mtrr_check(unsigned long base, unsigned long size) 406static int mtrr_check(unsigned long base, unsigned long size)
408{ 407{
409 if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) { 408 if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) {
410 pr_warn("mtrr: size and base must be multiples of 4 kiB\n"); 409 pr_warn("size and base must be multiples of 4 kiB\n");
411 pr_debug("mtrr: size: 0x%lx base: 0x%lx\n", size, base); 410 pr_debug("size: 0x%lx base: 0x%lx\n", size, base);
412 dump_stack(); 411 dump_stack();
413 return -1; 412 return -1;
414 } 413 }
@@ -499,22 +498,22 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size)
499 } 498 }
500 } 499 }
501 if (reg < 0) { 500 if (reg < 0) {
502 pr_debug("mtrr: no MTRR for %lx000,%lx000 found\n", 501 pr_debug("no MTRR for %lx000,%lx000 found\n",
503 base, size); 502 base, size);
504 goto out; 503 goto out;
505 } 504 }
506 } 505 }
507 if (reg >= max) { 506 if (reg >= max) {
508 pr_warn("mtrr: register: %d too big\n", reg); 507 pr_warn("register: %d too big\n", reg);
509 goto out; 508 goto out;
510 } 509 }
511 mtrr_if->get(reg, &lbase, &lsize, &ltype); 510 mtrr_if->get(reg, &lbase, &lsize, &ltype);
512 if (lsize < 1) { 511 if (lsize < 1) {
513 pr_warn("mtrr: MTRR %d not used\n", reg); 512 pr_warn("MTRR %d not used\n", reg);
514 goto out; 513 goto out;
515 } 514 }
516 if (mtrr_usage_table[reg] < 1) { 515 if (mtrr_usage_table[reg] < 1) {
517 pr_warn("mtrr: reg: %d has count=0\n", reg); 516 pr_warn("reg: %d has count=0\n", reg);
518 goto out; 517 goto out;
519 } 518 }
520 if (--mtrr_usage_table[reg] < 1) 519 if (--mtrr_usage_table[reg] < 1)
@@ -775,7 +774,7 @@ void __init mtrr_bp_init(void)
775 } 774 }
776 775
777 if (!mtrr_enabled()) { 776 if (!mtrr_enabled()) {
778 pr_info("MTRR: Disabled\n"); 777 pr_info("Disabled\n");
779 778
780 /* 779 /*
781 * PAT initialization relies on MTRR's rendezvous handler. 780 * PAT initialization relies on MTRR's rendezvous handler.