From 0d2be08893605be00de0f95ee7e4b8917ea1ebc3 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 5 Nov 2007 11:10:10 +0100 Subject: [S390] Fix compile on !CONFIG_SMP. Commit fae8b22d3e3e3a3d317a7746493997af02a3f35c "[S390] Add per-cpu idle time / idle count sysfs attributes" causes a link error on !CONFIG_SMP. Fix this by adding some #ifdef's. Real fix would be to cleanup the code since we don't register a cpu on !CONFIG_SMP. But that would be quite a big patch. For the time being this is good enough. arch/s390/kernel/built-in.o: In function `do_monitor_call': (.text+0x50d4): undefined reference to `per_cpu__s390_idle' arch/s390/kernel/built-in.o: In function `cpu_idle': (.text+0x518c): undefined reference to `per_cpu__s390_idle' make: *** [.tmp_vmlinux1] Error 1 Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/process.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 96492cf2d49..29f7884b4ff 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -92,6 +92,7 @@ EXPORT_SYMBOL(unregister_idle_notifier); void do_monitor_call(struct pt_regs *regs, long interruption_code) { +#ifdef CONFIG_SMP struct s390_idle_data *idle; idle = &__get_cpu_var(s390_idle); @@ -99,7 +100,7 @@ void do_monitor_call(struct pt_regs *regs, long interruption_code) idle->idle_time += get_clock() - idle->idle_enter; idle->in_idle = 0; spin_unlock(&idle->lock); - +#endif /* disable monitor call class 0 */ __ctl_clear_bit(8, 15); @@ -114,7 +115,9 @@ extern void s390_handle_mcck(void); static void default_idle(void) { int cpu, rc; +#ifdef CONFIG_SMP struct s390_idle_data *idle; +#endif /* CPU is going idle. */ cpu = smp_processor_id(); @@ -151,13 +154,14 @@ static void default_idle(void) s390_handle_mcck(); return; } - +#ifdef CONFIG_SMP idle = &__get_cpu_var(s390_idle); spin_lock(&idle->lock); idle->idle_count++; idle->in_idle = 1; idle->idle_enter = get_clock(); spin_unlock(&idle->lock); +#endif trace_hardirqs_on(); /* Wait for external, I/O or machine check interrupt. */ __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | -- cgit v1.2.3 From 0b8da654b6c13b40b0e0efd916ee57ed13f9fa1f Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 5 Nov 2007 11:10:11 +0100 Subject: [S390] Fix memory detection. Yet another patch in the countless series of memory detection fixes: if the last area of the reported storage size is a hole the detection loop will loop forever. Just break chunk detection loop if its end is going to be larger than reported storage size. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/early.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index e6289ee74ec..8bf4ae1150b 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -200,11 +200,13 @@ static noinline __init void find_memory_chunks(unsigned long memsize) cc = __tprot(addr); while (cc == old_cc) { addr += CHUNK_INCR; - cc = __tprot(addr); + if (addr >= memsize) + break; #ifndef CONFIG_64BIT if (addr == ADDR2G) break; #endif + cc = __tprot(addr); } if (old_addr != addr && -- cgit v1.2.3 From 69d39d6669a01e26ae6dbf5c3e84e0d1b6ccf332 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 5 Nov 2007 11:10:13 +0100 Subject: [S390] Rename "idle_time" attribute to "idle_time_us". Seems that people prefer to have the unit encoded in the attribute name. Also makes parsing easier. Now we have: # cat /sys/devices/system/cpu/cpu0/idle_time_us 131473592 instead of # cat /sys/devices/system/cpu/cpu0/idle_time 131473592 us Cc: Arjan van de Ven Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/smp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 1d97fe1c0e5..b05ae858425 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -788,14 +788,14 @@ static ssize_t show_idle_time(struct sys_device *dev, char *buf) } new_time = idle->idle_time; spin_unlock_irq(&idle->lock); - return sprintf(buf, "%llu us\n", new_time >> 12); + return sprintf(buf, "%llu\n", new_time >> 12); } -static SYSDEV_ATTR(idle_time, 0444, show_idle_time, NULL); +static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL); static struct attribute *cpu_attrs[] = { &attr_capability.attr, &attr_idle_count.attr, - &attr_idle_time.attr, + &attr_idle_time_us.attr, NULL, }; -- cgit v1.2.3 From d2cb0e6ecbe0ef93ab36631cd17ec6cf92b69c5a Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Mon, 5 Nov 2007 11:10:14 +0100 Subject: [S390] tod clock: announce clocksource as perfect The Time of Day clock is the standard time source for s390. It is - monotonic - allows very fast reading - architecture guarantees at least microsecond stepping - available as part of the architecture We should announce the rate of tod as 400 to be in sync with the description found in clocksource.h: "400-499:Perfect The ideal clocksource. A must-use where available." This change will prefer tod over less reliable clock sources. Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 48dae49bc1e..a963fe81359 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -307,7 +307,7 @@ static cycle_t read_tod_clock(void) static struct clocksource clocksource_tod = { .name = "tod", - .rating = 100, + .rating = 400, .read = read_tod_clock, .mask = -1ULL, .mult = 1000, -- cgit v1.2.3