aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-06-09 04:19:31 -0400
committerThomas Gleixner <tglx@linutronix.de>2014-06-21 17:05:40 -0400
commitb1bfd5ea451b60a4725907c282dec232c63f68bb (patch)
tree076ca5af359d401230ed2835cedcd72356078c56 /arch
parent43a775916d63d1c822107b39987192ca5ced445c (diff)
x86, mpparse: Use pr_lvl() helper utilities to replace printk(KERN_LVL)
Use pr_lvl() helper utilities to replace printk(KERN_LVL) for readability, no function changes. Also use pr_cont() to avoid multiple newlines in one printk(). Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Acked-by: David Rientjes <rientjes@google.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Yinghai Lu <yinghai@kernel.org> Link: http://lkml.kernel.org/r/1402302011-23642-3-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/mpparse.c95
1 files changed, 44 insertions, 51 deletions
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index d2b56489d70f..b10e1132f316 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -67,7 +67,7 @@ static void __init MP_processor_info(struct mpc_cpu *m)
67 boot_cpu_physical_apicid = m->apicid; 67 boot_cpu_physical_apicid = m->apicid;
68 } 68 }
69 69
70 printk(KERN_INFO "Processor #%d%s\n", m->apicid, bootup_cpu); 70 pr_info("Processor #%d%s\n", m->apicid, bootup_cpu);
71 generic_processor_info(apicid, m->apicver); 71 generic_processor_info(apicid, m->apicver);
72} 72}
73 73
@@ -87,9 +87,8 @@ static void __init MP_bus_info(struct mpc_bus *m)
87 87
88#if MAX_MP_BUSSES < 256 88#if MAX_MP_BUSSES < 256
89 if (m->busid >= MAX_MP_BUSSES) { 89 if (m->busid >= MAX_MP_BUSSES) {
90 printk(KERN_WARNING "MP table busid value (%d) for bustype %s " 90 pr_warn("MP table busid value (%d) for bustype %s is too large, max. supported is %d\n",
91 " is too large, max. supported is %d\n", 91 m->busid, str, MAX_MP_BUSSES - 1);
92 m->busid, str, MAX_MP_BUSSES - 1);
93 return; 92 return;
94 } 93 }
95#endif 94#endif
@@ -110,7 +109,7 @@ static void __init MP_bus_info(struct mpc_bus *m)
110 mp_bus_id_to_type[m->busid] = MP_BUS_EISA; 109 mp_bus_id_to_type[m->busid] = MP_BUS_EISA;
111#endif 110#endif
112 } else 111 } else
113 printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str); 112 pr_warn("Unknown bustype %s - ignoring\n", str);
114} 113}
115 114
116static void __init MP_ioapic_info(struct mpc_ioapic *m) 115static void __init MP_ioapic_info(struct mpc_ioapic *m)
@@ -121,8 +120,8 @@ static void __init MP_ioapic_info(struct mpc_ioapic *m)
121 120
122static void __init print_mp_irq_info(struct mpc_intsrc *mp_irq) 121static void __init print_mp_irq_info(struct mpc_intsrc *mp_irq)
123{ 122{
124 apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x," 123 apic_printk(APIC_VERBOSE,
125 " IRQ %02x, APIC ID %x, APIC INT %02x\n", 124 "Int: type %d, pol %d, trig %d, bus %02x, IRQ %02x, APIC ID %x, APIC INT %02x\n",
126 mp_irq->irqtype, mp_irq->irqflag & 3, 125 mp_irq->irqtype, mp_irq->irqflag & 3,
127 (mp_irq->irqflag >> 2) & 3, mp_irq->srcbus, 126 (mp_irq->irqflag >> 2) & 3, mp_irq->srcbus,
128 mp_irq->srcbusirq, mp_irq->dstapic, mp_irq->dstirq); 127 mp_irq->srcbusirq, mp_irq->dstapic, mp_irq->dstirq);
@@ -135,8 +134,8 @@ static inline void __init MP_ioapic_info(struct mpc_ioapic *m) {}
135 134
136static void __init MP_lintsrc_info(struct mpc_lintsrc *m) 135static void __init MP_lintsrc_info(struct mpc_lintsrc *m)
137{ 136{
138 apic_printk(APIC_VERBOSE, "Lint: type %d, pol %d, trig %d, bus %02x," 137 apic_printk(APIC_VERBOSE,
139 " IRQ %02x, APIC ID %x, APIC LINT %02x\n", 138 "Lint: type %d, pol %d, trig %d, bus %02x, IRQ %02x, APIC ID %x, APIC LINT %02x\n",
140 m->irqtype, m->irqflag & 3, (m->irqflag >> 2) & 3, m->srcbusid, 139 m->irqtype, m->irqflag & 3, (m->irqflag >> 2) & 3, m->srcbusid,
141 m->srcbusirq, m->destapic, m->destapiclint); 140 m->srcbusirq, m->destapic, m->destapiclint);
142} 141}
@@ -148,34 +147,33 @@ static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str)
148{ 147{
149 148
150 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { 149 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) {
151 printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n", 150 pr_err("MPTABLE: bad signature [%c%c%c%c]!\n",
152 mpc->signature[0], mpc->signature[1], 151 mpc->signature[0], mpc->signature[1],
153 mpc->signature[2], mpc->signature[3]); 152 mpc->signature[2], mpc->signature[3]);
154 return 0; 153 return 0;
155 } 154 }
156 if (mpf_checksum((unsigned char *)mpc, mpc->length)) { 155 if (mpf_checksum((unsigned char *)mpc, mpc->length)) {
157 printk(KERN_ERR "MPTABLE: checksum error!\n"); 156 pr_err("MPTABLE: checksum error!\n");
158 return 0; 157 return 0;
159 } 158 }
160 if (mpc->spec != 0x01 && mpc->spec != 0x04) { 159 if (mpc->spec != 0x01 && mpc->spec != 0x04) {
161 printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n", 160 pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec);
162 mpc->spec);
163 return 0; 161 return 0;
164 } 162 }
165 if (!mpc->lapic) { 163 if (!mpc->lapic) {
166 printk(KERN_ERR "MPTABLE: null local APIC address!\n"); 164 pr_err("MPTABLE: null local APIC address!\n");
167 return 0; 165 return 0;
168 } 166 }
169 memcpy(oem, mpc->oem, 8); 167 memcpy(oem, mpc->oem, 8);
170 oem[8] = 0; 168 oem[8] = 0;
171 printk(KERN_INFO "MPTABLE: OEM ID: %s\n", oem); 169 pr_info("MPTABLE: OEM ID: %s\n", oem);
172 170
173 memcpy(str, mpc->productid, 12); 171 memcpy(str, mpc->productid, 12);
174 str[12] = 0; 172 str[12] = 0;
175 173
176 printk(KERN_INFO "MPTABLE: Product ID: %s\n", str); 174 pr_info("MPTABLE: Product ID: %s\n", str);
177 175
178 printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->lapic); 176 pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic);
179 177
180 return 1; 178 return 1;
181} 179}
@@ -188,8 +186,8 @@ static void skip_entry(unsigned char **ptr, int *count, int size)
188 186
189static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt) 187static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt)
190{ 188{
191 printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n" 189 pr_err("Your mptable is wrong, contact your HW vendor!\n");
192 "type %x\n", *mpt); 190 pr_cont("type %x\n", *mpt);
193 print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, 191 print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
194 1, mpc, mpc->length, 1); 192 1, mpc, mpc->length, 1);
195} 193}
@@ -259,7 +257,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
259 } 257 }
260 258
261 if (!num_processors) 259 if (!num_processors)
262 printk(KERN_ERR "MPTABLE: no processors registered!\n"); 260 pr_err("MPTABLE: no processors registered!\n");
263 return num_processors; 261 return num_processors;
264} 262}
265 263
@@ -295,16 +293,13 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type)
295 * If it does, we assume it's valid. 293 * If it does, we assume it's valid.
296 */ 294 */
297 if (mpc_default_type == 5) { 295 if (mpc_default_type == 5) {
298 printk(KERN_INFO "ISA/PCI bus type with no IRQ information... " 296 pr_info("ISA/PCI bus type with no IRQ information... falling back to ELCR\n");
299 "falling back to ELCR\n");
300 297
301 if (ELCR_trigger(0) || ELCR_trigger(1) || ELCR_trigger(2) || 298 if (ELCR_trigger(0) || ELCR_trigger(1) || ELCR_trigger(2) ||
302 ELCR_trigger(13)) 299 ELCR_trigger(13))
303 printk(KERN_ERR "ELCR contains invalid data... " 300 pr_err("ELCR contains invalid data... not using ELCR\n");
304 "not using ELCR\n");
305 else { 301 else {
306 printk(KERN_INFO 302 pr_info("Using ELCR to identify PCI interrupts\n");
307 "Using ELCR to identify PCI interrupts\n");
308 ELCR_fallback = 1; 303 ELCR_fallback = 1;
309 } 304 }
310 } 305 }
@@ -353,7 +348,7 @@ static void __init construct_ioapic_table(int mpc_default_type)
353 bus.busid = 0; 348 bus.busid = 0;
354 switch (mpc_default_type) { 349 switch (mpc_default_type) {
355 default: 350 default:
356 printk(KERN_ERR "???\nUnknown standard configuration %d\n", 351 pr_err("???\nUnknown standard configuration %d\n",
357 mpc_default_type); 352 mpc_default_type);
358 /* fall through */ 353 /* fall through */
359 case 1: 354 case 1:
@@ -462,8 +457,8 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early)
462#ifdef CONFIG_X86_LOCAL_APIC 457#ifdef CONFIG_X86_LOCAL_APIC
463 smp_found_config = 0; 458 smp_found_config = 0;
464#endif 459#endif
465 printk(KERN_ERR "BIOS bug, MP table errors detected!...\n" 460 pr_err("BIOS bug, MP table errors detected!...\n");
466 "... disabling SMP support. (tell your hw vendor)\n"); 461 pr_cont("... disabling SMP support. (tell your hw vendor)\n");
467 early_iounmap(mpc, size); 462 early_iounmap(mpc, size);
468 return -1; 463 return -1;
469 } 464 }
@@ -481,8 +476,7 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early)
481 if (!mp_irq_entries) { 476 if (!mp_irq_entries) {
482 struct mpc_bus bus; 477 struct mpc_bus bus;
483 478
484 printk(KERN_ERR "BIOS bug, no explicit IRQ entries, " 479 pr_err("BIOS bug, no explicit IRQ entries, using default mptable. (tell your hw vendor)\n");
485 "using default mptable. (tell your hw vendor)\n");
486 480
487 bus.type = MP_BUS; 481 bus.type = MP_BUS;
488 bus.busid = 0; 482 bus.busid = 0;
@@ -516,14 +510,14 @@ void __init default_get_smp_config(unsigned int early)
516 if (acpi_lapic && acpi_ioapic) 510 if (acpi_lapic && acpi_ioapic)
517 return; 511 return;
518 512
519 printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", 513 pr_info("Intel MultiProcessor Specification v1.%d\n",
520 mpf->specification); 514 mpf->specification);
521#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) 515#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
522 if (mpf->feature2 & (1 << 7)) { 516 if (mpf->feature2 & (1 << 7)) {
523 printk(KERN_INFO " IMCR and PIC compatibility mode.\n"); 517 pr_info(" IMCR and PIC compatibility mode.\n");
524 pic_mode = 1; 518 pic_mode = 1;
525 } else { 519 } else {
526 printk(KERN_INFO " Virtual Wire compatibility mode.\n"); 520 pr_info(" Virtual Wire compatibility mode.\n");
527 pic_mode = 0; 521 pic_mode = 0;
528 } 522 }
529#endif 523#endif
@@ -539,8 +533,7 @@ void __init default_get_smp_config(unsigned int early)
539 return; 533 return;
540 } 534 }
541 535
542 printk(KERN_INFO "Default MP configuration #%d\n", 536 pr_info("Default MP configuration #%d\n", mpf->feature1);
543 mpf->feature1);
544 construct_default_ISA_mptable(mpf->feature1); 537 construct_default_ISA_mptable(mpf->feature1);
545 538
546 } else if (mpf->physptr) { 539 } else if (mpf->physptr) {
@@ -550,7 +543,7 @@ void __init default_get_smp_config(unsigned int early)
550 BUG(); 543 BUG();
551 544
552 if (!early) 545 if (!early)
553 printk(KERN_INFO "Processors: %d\n", num_processors); 546 pr_info("Processors: %d\n", num_processors);
554 /* 547 /*
555 * Only use the first configuration found. 548 * Only use the first configuration found.
556 */ 549 */
@@ -583,10 +576,10 @@ static int __init smp_scan_config(unsigned long base, unsigned long length)
583#endif 576#endif
584 mpf_found = mpf; 577 mpf_found = mpf;
585 578
586 printk(KERN_INFO "found SMP MP-table at [mem %#010llx-%#010llx] mapped at [%p]\n", 579 pr_info("found SMP MP-table at [mem %#010llx-%#010llx] mapped at [%p]\n",
587 (unsigned long long) virt_to_phys(mpf), 580 (unsigned long long) virt_to_phys(mpf),
588 (unsigned long long) virt_to_phys(mpf) + 581 (unsigned long long) virt_to_phys(mpf) +
589 sizeof(*mpf) - 1, mpf); 582 sizeof(*mpf) - 1, mpf);
590 583
591 mem = virt_to_phys(mpf); 584 mem = virt_to_phys(mpf);
592 memblock_reserve(mem, sizeof(*mpf)); 585 memblock_reserve(mem, sizeof(*mpf));
@@ -735,7 +728,7 @@ static int __init replace_intsrc_all(struct mpc_table *mpc,
735 int nr_m_spare = 0; 728 int nr_m_spare = 0;
736 unsigned char *mpt = ((unsigned char *)mpc) + count; 729 unsigned char *mpt = ((unsigned char *)mpc) + count;
737 730
738 printk(KERN_INFO "mpc_length %x\n", mpc->length); 731 pr_info("mpc_length %x\n", mpc->length);
739 while (count < mpc->length) { 732 while (count < mpc->length) {
740 switch (*mpt) { 733 switch (*mpt) {
741 case MP_PROCESSOR: 734 case MP_PROCESSOR:
@@ -862,13 +855,13 @@ static int __init update_mp_table(void)
862 if (!smp_check_mpc(mpc, oem, str)) 855 if (!smp_check_mpc(mpc, oem, str))
863 return 0; 856 return 0;
864 857
865 printk(KERN_INFO "mpf: %llx\n", (u64)virt_to_phys(mpf)); 858 pr_info("mpf: %llx\n", (u64)virt_to_phys(mpf));
866 printk(KERN_INFO "physptr: %x\n", mpf->physptr); 859 pr_info("physptr: %x\n", mpf->physptr);
867 860
868 if (mpc_new_phys && mpc->length > mpc_new_length) { 861 if (mpc_new_phys && mpc->length > mpc_new_length) {
869 mpc_new_phys = 0; 862 mpc_new_phys = 0;
870 printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n", 863 pr_info("mpc_new_length is %ld, please use alloc_mptable=8k\n",
871 mpc_new_length); 864 mpc_new_length);
872 } 865 }
873 866
874 if (!mpc_new_phys) { 867 if (!mpc_new_phys) {
@@ -879,10 +872,10 @@ static int __init update_mp_table(void)
879 mpc->checksum = 0xff; 872 mpc->checksum = 0xff;
880 new = mpf_checksum((unsigned char *)mpc, mpc->length); 873 new = mpf_checksum((unsigned char *)mpc, mpc->length);
881 if (old == new) { 874 if (old == new) {
882 printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n"); 875 pr_info("mpc is readonly, please try alloc_mptable instead\n");
883 return 0; 876 return 0;
884 } 877 }
885 printk(KERN_INFO "use in-position replacing\n"); 878 pr_info("use in-position replacing\n");
886 } else { 879 } else {
887 mpf->physptr = mpc_new_phys; 880 mpf->physptr = mpc_new_phys;
888 mpc_new = phys_to_virt(mpc_new_phys); 881 mpc_new = phys_to_virt(mpc_new_phys);
@@ -892,7 +885,7 @@ static int __init update_mp_table(void)
892 if (mpc_new_phys - mpf->physptr) { 885 if (mpc_new_phys - mpf->physptr) {
893 struct mpf_intel *mpf_new; 886 struct mpf_intel *mpf_new;
894 /* steal 16 bytes from [0, 1k) */ 887 /* steal 16 bytes from [0, 1k) */
895 printk(KERN_INFO "mpf new: %x\n", 0x400 - 16); 888 pr_info("mpf new: %x\n", 0x400 - 16);
896 mpf_new = phys_to_virt(0x400 - 16); 889 mpf_new = phys_to_virt(0x400 - 16);
897 memcpy(mpf_new, mpf, 16); 890 memcpy(mpf_new, mpf, 16);
898 mpf = mpf_new; 891 mpf = mpf_new;
@@ -900,7 +893,7 @@ static int __init update_mp_table(void)
900 } 893 }
901 mpf->checksum = 0; 894 mpf->checksum = 0;
902 mpf->checksum -= mpf_checksum((unsigned char *)mpf, 16); 895 mpf->checksum -= mpf_checksum((unsigned char *)mpf, 16);
903 printk(KERN_INFO "physptr new: %x\n", mpf->physptr); 896 pr_info("physptr new: %x\n", mpf->physptr);
904 } 897 }
905 898
906 /* 899 /*