Skip to content

Commit 395d31d

Browse files
author
Martin Schwidefsky
committed
[S390] convert cpu related printks to pr_xxx macros.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 74eacdb commit 395d31d

5 files changed

Lines changed: 112 additions & 100 deletions

File tree

‎arch/s390/kernel/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ CFLAGS_smp.o := -Wno-nonnull
1717
#
1818
CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
1919

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 \
2222
s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \
2323
vdso.o vtime.o
2424

‎arch/s390/kernel/processor.c‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
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+
};
98+

‎arch/s390/kernel/setup.c‎

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <linux/bootmem.h>
3636
#include <linux/root_dev.h>
3737
#include <linux/console.h>
38-
#include <linux/seq_file.h>
3938
#include <linux/kernel_stat.h>
4039
#include <linux/device.h>
4140
#include <linux/notifier.h>
@@ -829,90 +828,3 @@ setup_arch(char **cmdline_p)
829828
/* Setup zfcpdump support */
830829
setup_zfcpdump(console_devno);
831830
}
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-
};
918-

‎arch/s390/kernel/smp.c‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
* cpu_number_map in other architectures.
2121
*/
2222

23+
#define KMSG_COMPONENT "cpu"
24+
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
25+
2326
#include <linux/module.h>
2427
#include <linux/init.h>
2528
#include <linux/mm.h>
@@ -251,8 +254,8 @@ static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu)
251254
if (ipl_info.type != IPL_TYPE_FCP_DUMP)
252255
return;
253256
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);
256259
return;
257260
}
258261
zfcpdump_save_areas[cpu] = kmalloc(sizeof(union save_area), GFP_KERNEL);
@@ -425,7 +428,7 @@ static void __init smp_detect_cpus(void)
425428
}
426429
out:
427430
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);
429432
get_online_cpus();
430433
__smp_rescan_cpus();
431434
put_online_cpus();
@@ -548,12 +551,8 @@ int __cpuinit __cpu_up(unsigned int cpu)
548551

549552
ccode = signal_processor_p((__u32)(unsigned long)(lowcore_ptr[cpu]),
550553
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)
555555
return -EIO;
556-
}
557556

558557
idle = current_set[cpu];
559558
cpu_lowcore = lowcore_ptr[cpu];
@@ -636,7 +635,7 @@ void __cpu_die(unsigned int cpu)
636635
while (!smp_cpu_not_running(cpu))
637636
cpu_relax();
638637
smp_free_lowcore(cpu);
639-
printk(KERN_INFO "Processor %d spun down\n", cpu);
638+
pr_info("Processor %d stopped\n", cpu);
640639
}
641640

642641
void cpu_die(void)

‎arch/s390/kernel/topology.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
44
*/
55

6+
#define KMSG_COMPONENT "cpu"
7+
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
8+
69
#include <linux/kernel.h>
710
#include <linux/mm.h>
811
#include <linux/init.h>
@@ -306,7 +309,7 @@ void __init s390_init_cpu_topology(void)
306309
for (i = 0; i < info->mnest - 2; i++)
307310
nr_cores *= info->mag[NR_MAG - 3 - i];
308311

309-
printk(KERN_INFO "CPU topology:");
312+
pr_info("The CPU configuration topology of the machine is:");
310313
for (i = 0; i < NR_MAG; i++)
311314
printk(" %d", info->mag[i]);
312315
printk(" / %d\n", info->mnest);

0 commit comments

Comments
 (0)