Commit 395d31d40cc38270dd7c024691404e2eddf0678d
1 parent
74eacdb9c2
Exists in
master
and in
7 other branches
[S390] convert cpu related printks to pr_xxx macros.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Showing 5 changed files with 112 additions and 100 deletions Side-by-side Diff
arch/s390/kernel/Makefile
... | ... | @@ -17,8 +17,8 @@ |
17 | 17 | # |
18 | 18 | CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' |
19 | 19 | |
20 | -obj-y := bitmap.o traps.o time.o process.o base.o early.o \ | |
21 | - setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ | |
20 | +obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \ | |
21 | + processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ | |
22 | 22 | s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \ |
23 | 23 | vdso.o vtime.o |
24 | 24 |
arch/s390/kernel/processor.c
1 | +/* | |
2 | + * arch/s390/kernel/processor.c | |
3 | + * | |
4 | + * Copyright IBM Corp. 2008 | |
5 | + * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) | |
6 | + */ | |
7 | + | |
8 | +#define KMSG_COMPONENT "cpu" | |
9 | +#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | |
10 | + | |
11 | +#include <linux/kernel.h> | |
12 | +#include <linux/init.h> | |
13 | +#include <linux/smp.h> | |
14 | +#include <linux/seq_file.h> | |
15 | +#include <linux/delay.h> | |
16 | + | |
17 | +#include <asm/elf.h> | |
18 | +#include <asm/lowcore.h> | |
19 | +#include <asm/param.h> | |
20 | + | |
21 | +void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo) | |
22 | +{ | |
23 | + pr_info("Processor %d started, address %d, identification %06X\n", | |
24 | + cpuinfo->cpu_nr, cpuinfo->cpu_addr, cpuinfo->cpu_id.ident); | |
25 | +} | |
26 | + | |
27 | +/* | |
28 | + * show_cpuinfo - Get information on one CPU for use by procfs. | |
29 | + */ | |
30 | + | |
31 | +static int show_cpuinfo(struct seq_file *m, void *v) | |
32 | +{ | |
33 | + static const char *hwcap_str[8] = { | |
34 | + "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", | |
35 | + "edat" | |
36 | + }; | |
37 | + struct cpuinfo_S390 *cpuinfo; | |
38 | + unsigned long n = (unsigned long) v - 1; | |
39 | + int i; | |
40 | + | |
41 | + s390_adjust_jiffies(); | |
42 | + preempt_disable(); | |
43 | + if (!n) { | |
44 | + seq_printf(m, "vendor_id : IBM/S390\n" | |
45 | + "# processors : %i\n" | |
46 | + "bogomips per cpu: %lu.%02lu\n", | |
47 | + num_online_cpus(), loops_per_jiffy/(500000/HZ), | |
48 | + (loops_per_jiffy/(5000/HZ))%100); | |
49 | + seq_puts(m, "features\t: "); | |
50 | + for (i = 0; i < 8; i++) | |
51 | + if (hwcap_str[i] && (elf_hwcap & (1UL << i))) | |
52 | + seq_printf(m, "%s ", hwcap_str[i]); | |
53 | + seq_puts(m, "\n"); | |
54 | + } | |
55 | + | |
56 | + if (cpu_online(n)) { | |
57 | +#ifdef CONFIG_SMP | |
58 | + if (smp_processor_id() == n) | |
59 | + cpuinfo = &S390_lowcore.cpu_data; | |
60 | + else | |
61 | + cpuinfo = &lowcore_ptr[n]->cpu_data; | |
62 | +#else | |
63 | + cpuinfo = &S390_lowcore.cpu_data; | |
64 | +#endif | |
65 | + seq_printf(m, "processor %li: " | |
66 | + "version = %02X, " | |
67 | + "identification = %06X, " | |
68 | + "machine = %04X\n", | |
69 | + n, cpuinfo->cpu_id.version, | |
70 | + cpuinfo->cpu_id.ident, | |
71 | + cpuinfo->cpu_id.machine); | |
72 | + } | |
73 | + preempt_enable(); | |
74 | + return 0; | |
75 | +} | |
76 | + | |
77 | +static void *c_start(struct seq_file *m, loff_t *pos) | |
78 | +{ | |
79 | + return *pos < NR_CPUS ? (void *)((unsigned long) *pos + 1) : NULL; | |
80 | +} | |
81 | + | |
82 | +static void *c_next(struct seq_file *m, void *v, loff_t *pos) | |
83 | +{ | |
84 | + ++*pos; | |
85 | + return c_start(m, pos); | |
86 | +} | |
87 | + | |
88 | +static void c_stop(struct seq_file *m, void *v) | |
89 | +{ | |
90 | +} | |
91 | + | |
92 | +const struct seq_operations cpuinfo_op = { | |
93 | + .start = c_start, | |
94 | + .next = c_next, | |
95 | + .stop = c_stop, | |
96 | + .show = show_cpuinfo, | |
97 | +}; |
arch/s390/kernel/setup.c
... | ... | @@ -35,7 +35,6 @@ |
35 | 35 | #include <linux/bootmem.h> |
36 | 36 | #include <linux/root_dev.h> |
37 | 37 | #include <linux/console.h> |
38 | -#include <linux/seq_file.h> | |
39 | 38 | #include <linux/kernel_stat.h> |
40 | 39 | #include <linux/device.h> |
41 | 40 | #include <linux/notifier.h> |
... | ... | @@ -829,90 +828,4 @@ |
829 | 828 | /* Setup zfcpdump support */ |
830 | 829 | setup_zfcpdump(console_devno); |
831 | 830 | } |
832 | - | |
833 | -void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo) | |
834 | -{ | |
835 | - printk(KERN_INFO "cpu %d " | |
836 | -#ifdef CONFIG_SMP | |
837 | - "phys_idx=%d " | |
838 | -#endif | |
839 | - "vers=%02X ident=%06X machine=%04X unused=%04X\n", | |
840 | - cpuinfo->cpu_nr, | |
841 | -#ifdef CONFIG_SMP | |
842 | - cpuinfo->cpu_addr, | |
843 | -#endif | |
844 | - cpuinfo->cpu_id.version, | |
845 | - cpuinfo->cpu_id.ident, | |
846 | - cpuinfo->cpu_id.machine, | |
847 | - cpuinfo->cpu_id.unused); | |
848 | -} | |
849 | - | |
850 | -/* | |
851 | - * show_cpuinfo - Get information on one CPU for use by procfs. | |
852 | - */ | |
853 | - | |
854 | -static int show_cpuinfo(struct seq_file *m, void *v) | |
855 | -{ | |
856 | - static const char *hwcap_str[8] = { | |
857 | - "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", | |
858 | - "edat" | |
859 | - }; | |
860 | - struct cpuinfo_S390 *cpuinfo; | |
861 | - unsigned long n = (unsigned long) v - 1; | |
862 | - int i; | |
863 | - | |
864 | - s390_adjust_jiffies(); | |
865 | - preempt_disable(); | |
866 | - if (!n) { | |
867 | - seq_printf(m, "vendor_id : IBM/S390\n" | |
868 | - "# processors : %i\n" | |
869 | - "bogomips per cpu: %lu.%02lu\n", | |
870 | - num_online_cpus(), loops_per_jiffy/(500000/HZ), | |
871 | - (loops_per_jiffy/(5000/HZ))%100); | |
872 | - seq_puts(m, "features\t: "); | |
873 | - for (i = 0; i < 8; i++) | |
874 | - if (hwcap_str[i] && (elf_hwcap & (1UL << i))) | |
875 | - seq_printf(m, "%s ", hwcap_str[i]); | |
876 | - seq_puts(m, "\n"); | |
877 | - } | |
878 | - | |
879 | - if (cpu_online(n)) { | |
880 | -#ifdef CONFIG_SMP | |
881 | - if (smp_processor_id() == n) | |
882 | - cpuinfo = &S390_lowcore.cpu_data; | |
883 | - else | |
884 | - cpuinfo = &lowcore_ptr[n]->cpu_data; | |
885 | -#else | |
886 | - cpuinfo = &S390_lowcore.cpu_data; | |
887 | -#endif | |
888 | - seq_printf(m, "processor %li: " | |
889 | - "version = %02X, " | |
890 | - "identification = %06X, " | |
891 | - "machine = %04X\n", | |
892 | - n, cpuinfo->cpu_id.version, | |
893 | - cpuinfo->cpu_id.ident, | |
894 | - cpuinfo->cpu_id.machine); | |
895 | - } | |
896 | - preempt_enable(); | |
897 | - return 0; | |
898 | -} | |
899 | - | |
900 | -static void *c_start(struct seq_file *m, loff_t *pos) | |
901 | -{ | |
902 | - return *pos < NR_CPUS ? (void *)((unsigned long) *pos + 1) : NULL; | |
903 | -} | |
904 | -static void *c_next(struct seq_file *m, void *v, loff_t *pos) | |
905 | -{ | |
906 | - ++*pos; | |
907 | - return c_start(m, pos); | |
908 | -} | |
909 | -static void c_stop(struct seq_file *m, void *v) | |
910 | -{ | |
911 | -} | |
912 | -const struct seq_operations cpuinfo_op = { | |
913 | - .start = c_start, | |
914 | - .next = c_next, | |
915 | - .stop = c_stop, | |
916 | - .show = show_cpuinfo, | |
917 | -}; |
arch/s390/kernel/smp.c
... | ... | @@ -20,6 +20,9 @@ |
20 | 20 | * cpu_number_map in other architectures. |
21 | 21 | */ |
22 | 22 | |
23 | +#define KMSG_COMPONENT "cpu" | |
24 | +#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | |
25 | + | |
23 | 26 | #include <linux/module.h> |
24 | 27 | #include <linux/init.h> |
25 | 28 | #include <linux/mm.h> |
... | ... | @@ -251,8 +254,8 @@ |
251 | 254 | if (ipl_info.type != IPL_TYPE_FCP_DUMP) |
252 | 255 | return; |
253 | 256 | if (cpu >= NR_CPUS) { |
254 | - printk(KERN_WARNING "Registers for cpu %i not saved since dump " | |
255 | - "kernel was compiled with NR_CPUS=%i\n", cpu, NR_CPUS); | |
257 | + pr_warning("CPU %i exceeds the maximum %i and is excluded from " | |
258 | + "the dump\n", cpu, NR_CPUS - 1); | |
256 | 259 | return; |
257 | 260 | } |
258 | 261 | zfcpdump_save_areas[cpu] = kmalloc(sizeof(union save_area), GFP_KERNEL); |
... | ... | @@ -425,7 +428,7 @@ |
425 | 428 | } |
426 | 429 | out: |
427 | 430 | kfree(info); |
428 | - printk(KERN_INFO "CPUs: %d configured, %d standby\n", c_cpus, s_cpus); | |
431 | + pr_info("%d configured CPUs, %d standby CPUs\n", c_cpus, s_cpus); | |
429 | 432 | get_online_cpus(); |
430 | 433 | __smp_rescan_cpus(); |
431 | 434 | put_online_cpus(); |
432 | 435 | |
... | ... | @@ -548,12 +551,8 @@ |
548 | 551 | |
549 | 552 | ccode = signal_processor_p((__u32)(unsigned long)(lowcore_ptr[cpu]), |
550 | 553 | cpu, sigp_set_prefix); |
551 | - if (ccode) { | |
552 | - printk("sigp_set_prefix failed for cpu %d " | |
553 | - "with condition code %d\n", | |
554 | - (int) cpu, (int) ccode); | |
554 | + if (ccode) | |
555 | 555 | return -EIO; |
556 | - } | |
557 | 556 | |
558 | 557 | idle = current_set[cpu]; |
559 | 558 | cpu_lowcore = lowcore_ptr[cpu]; |
... | ... | @@ -636,7 +635,7 @@ |
636 | 635 | while (!smp_cpu_not_running(cpu)) |
637 | 636 | cpu_relax(); |
638 | 637 | smp_free_lowcore(cpu); |
639 | - printk(KERN_INFO "Processor %d spun down\n", cpu); | |
638 | + pr_info("Processor %d stopped\n", cpu); | |
640 | 639 | } |
641 | 640 | |
642 | 641 | void cpu_die(void) |
arch/s390/kernel/topology.c
... | ... | @@ -3,6 +3,9 @@ |
3 | 3 | * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com> |
4 | 4 | */ |
5 | 5 | |
6 | +#define KMSG_COMPONENT "cpu" | |
7 | +#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | |
8 | + | |
6 | 9 | #include <linux/kernel.h> |
7 | 10 | #include <linux/mm.h> |
8 | 11 | #include <linux/init.h> |
... | ... | @@ -306,7 +309,7 @@ |
306 | 309 | for (i = 0; i < info->mnest - 2; i++) |
307 | 310 | nr_cores *= info->mag[NR_MAG - 3 - i]; |
308 | 311 | |
309 | - printk(KERN_INFO "CPU topology:"); | |
312 | + pr_info("The CPU configuration topology of the machine is:"); | |
310 | 313 | for (i = 0; i < NR_MAG; i++) |
311 | 314 | printk(" %d", info->mag[i]); |
312 | 315 | printk(" / %d\n", info->mnest); |