aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:39:50 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:39:25 -0500
commit395d31d40cc38270dd7c024691404e2eddf0678d (patch)
tree6e1a0f4114985f612090bedb00b8a4c860b815e4 /arch/s390
parent74eacdb9c2bf9fc6e8c6785013b5dd0e551a9dfa (diff)
[S390] convert cpu related printks to pr_xxx macros.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/Makefile4
-rw-r--r--arch/s390/kernel/processor.c98
-rw-r--r--arch/s390/kernel/setup.c88
-rw-r--r--arch/s390/kernel/smp.c17
-rw-r--r--arch/s390/kernel/topology.c5
5 files changed, 112 insertions, 100 deletions
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 90dad65c20ec..3edc6c6f258b 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -17,8 +17,8 @@ CFLAGS_smp.o := -Wno-nonnull
17# 17#
18CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' 18CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
19 19
20obj-y := bitmap.o traps.o time.o process.o base.o early.o \ 20obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \
21 setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ 21 processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
22 s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \ 22 s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \
23 vdso.o vtime.o 23 vdso.o vtime.o
24 24
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c
new file mode 100644
index 000000000000..82c1872cfe80
--- /dev/null
+++ b/arch/s390/kernel/processor.c
@@ -0,0 +1,98 @@
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
21void __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
31static 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
77static void *c_start(struct seq_file *m, loff_t *pos)
78{
79 return *pos < NR_CPUS ? (void *)((unsigned long) *pos + 1) : NULL;
80}
81
82static void *c_next(struct seq_file *m, void *v, loff_t *pos)
83{
84 ++*pos;
85 return c_start(m, pos);
86}
87
88static void c_stop(struct seq_file *m, void *v)
89{
90}
91
92const struct seq_operations cpuinfo_op = {
93 .start = c_start,
94 .next = c_next,
95 .stop = c_stop,
96 .show = show_cpuinfo,
97};
98
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index ba724d180be7..b7a1efd5522c 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -35,7 +35,6 @@
35#include <linux/bootmem.h> 35#include <linux/bootmem.h>
36#include <linux/root_dev.h> 36#include <linux/root_dev.h>
37#include <linux/console.h> 37#include <linux/console.h>
38#include <linux/seq_file.h>
39#include <linux/kernel_stat.h> 38#include <linux/kernel_stat.h>
40#include <linux/device.h> 39#include <linux/device.h>
41#include <linux/notifier.h> 40#include <linux/notifier.h>
@@ -829,90 +828,3 @@ setup_arch(char **cmdline_p)
829 /* Setup zfcpdump support */ 828 /* Setup zfcpdump support */
830 setup_zfcpdump(console_devno); 829 setup_zfcpdump(console_devno);
831} 830}
832
833void __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
854static 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
900static void *c_start(struct seq_file *m, loff_t *pos)
901{
902 return *pos < NR_CPUS ? (void *)((unsigned long) *pos + 1) : NULL;
903}
904static void *c_next(struct seq_file *m, void *v, loff_t *pos)
905{
906 ++*pos;
907 return c_start(m, pos);
908}
909static void c_stop(struct seq_file *m, void *v)
910{
911}
912const struct seq_operations cpuinfo_op = {
913 .start = c_start,
914 .next = c_next,
915 .stop = c_stop,
916 .show = show_cpuinfo,
917};
918
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 1e7db1ab7453..6fc78541dc57 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -20,6 +20,9 @@
20 * cpu_number_map in other architectures. 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#include <linux/module.h> 26#include <linux/module.h>
24#include <linux/init.h> 27#include <linux/init.h>
25#include <linux/mm.h> 28#include <linux/mm.h>
@@ -251,8 +254,8 @@ static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu)
251 if (ipl_info.type != IPL_TYPE_FCP_DUMP) 254 if (ipl_info.type != IPL_TYPE_FCP_DUMP)
252 return; 255 return;
253 if (cpu >= NR_CPUS) { 256 if (cpu >= NR_CPUS) {
254 printk(KERN_WARNING "Registers for cpu %i not saved since dump " 257 pr_warning("CPU %i exceeds the maximum %i and is excluded from "
255 "kernel was compiled with NR_CPUS=%i\n", cpu, NR_CPUS); 258 "the dump\n", cpu, NR_CPUS - 1);
256 return; 259 return;
257 } 260 }
258 zfcpdump_save_areas[cpu] = kmalloc(sizeof(union save_area), GFP_KERNEL); 261 zfcpdump_save_areas[cpu] = kmalloc(sizeof(union save_area), GFP_KERNEL);
@@ -425,7 +428,7 @@ static void __init smp_detect_cpus(void)
425 } 428 }
426out: 429out:
427 kfree(info); 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 get_online_cpus(); 432 get_online_cpus();
430 __smp_rescan_cpus(); 433 __smp_rescan_cpus();
431 put_online_cpus(); 434 put_online_cpus();
@@ -548,12 +551,8 @@ int __cpuinit __cpu_up(unsigned int cpu)
548 551
549 ccode = signal_processor_p((__u32)(unsigned long)(lowcore_ptr[cpu]), 552 ccode = signal_processor_p((__u32)(unsigned long)(lowcore_ptr[cpu]),
550 cpu, sigp_set_prefix); 553 cpu, sigp_set_prefix);
551 if (ccode) { 554 if (ccode)
552 printk("sigp_set_prefix failed for cpu %d "
553 "with condition code %d\n",
554 (int) cpu, (int) ccode);
555 return -EIO; 555 return -EIO;
556 }
557 556
558 idle = current_set[cpu]; 557 idle = current_set[cpu];
559 cpu_lowcore = lowcore_ptr[cpu]; 558 cpu_lowcore = lowcore_ptr[cpu];
@@ -636,7 +635,7 @@ void __cpu_die(unsigned int cpu)
636 while (!smp_cpu_not_running(cpu)) 635 while (!smp_cpu_not_running(cpu))
637 cpu_relax(); 636 cpu_relax();
638 smp_free_lowcore(cpu); 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
642void cpu_die(void) 641void cpu_die(void)
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index b3aac53fd6dc..83579ed62933 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -3,6 +3,9 @@
3 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com> 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#include <linux/kernel.h> 9#include <linux/kernel.h>
7#include <linux/mm.h> 10#include <linux/mm.h>
8#include <linux/init.h> 11#include <linux/init.h>
@@ -306,7 +309,7 @@ void __init s390_init_cpu_topology(void)
306 for (i = 0; i < info->mnest - 2; i++) 309 for (i = 0; i < info->mnest - 2; i++)
307 nr_cores *= info->mag[NR_MAG - 3 - i]; 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 for (i = 0; i < NR_MAG; i++) 313 for (i = 0; i < NR_MAG; i++)
311 printk(" %d", info->mag[i]); 314 printk(" %d", info->mag[i]);
312 printk(" / %d\n", info->mnest); 315 printk(" / %d\n", info->mnest);