From d879c173354db476d4b45f9bc2a8775d9c6d5930 Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Sat, 22 Aug 2009 18:09:27 +0200 Subject: [PATCH] --- yaml --- r: 162848 b: refs/heads/master c: 2882b0c63ac6085fd5c18959240b6f7d6ffb8d5b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/mips/alchemy/common/time.c | 15 +++++++++------ trunk/arch/mips/kernel/cpu-probe.c | 13 +++++-------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 2745d15410c6..faaa250e9961 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9d24bafb0d1ecf636f71a56f9d6f071f5c7a882d +refs/heads/master: 2882b0c63ac6085fd5c18959240b6f7d6ffb8d5b diff --git a/trunk/arch/mips/alchemy/common/time.c b/trunk/arch/mips/alchemy/common/time.c index 33fbae79af5e..f34ff8601942 100644 --- a/trunk/arch/mips/alchemy/common/time.c +++ b/trunk/arch/mips/alchemy/common/time.c @@ -36,14 +36,13 @@ #include #include +#include #include #include /* 32kHz clock enabled and detected */ #define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S) -extern int allow_au1k_wait; /* default off for CP0 Counter */ - static cycle_t au1x_counter1_read(struct clocksource *cs) { return au_readl(SYS_RTCREAD); @@ -153,13 +152,17 @@ void __init plat_time_init(void) printk(KERN_INFO "Alchemy clocksource installed\n"); - /* can now use 'wait' */ - allow_au1k_wait = 1; return; cntr_err: - /* counters unusable, use C0 counter */ + /* + * MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this + * function is called. Because the Alchemy counters are unusable + * the C0 timekeeping code is installed and use of the 'wait' + * instruction must be prohibited, which is done most easily by + * assigning NULL to cpu_wait. + */ + cpu_wait = NULL; r4k_clockevent_init(); init_r4k_clocksource(); - allow_au1k_wait = 0; } diff --git a/trunk/arch/mips/kernel/cpu-probe.c b/trunk/arch/mips/kernel/cpu-probe.c index 1abe9905c9c1..6e4807a19c00 100644 --- a/trunk/arch/mips/kernel/cpu-probe.c +++ b/trunk/arch/mips/kernel/cpu-probe.c @@ -91,16 +91,13 @@ static void rm7k_wait_irqoff(void) local_irq_enable(); } -/* The Au1xxx wait is available only if using 32khz counter or - * external timer source, but specifically not CP0 Counter. */ -int allow_au1k_wait; - +/* + * The Au1xxx wait is available only if using 32khz counter or + * external timer source, but specifically not CP0 Counter. + * alchemy/common/time.c may override cpu_wait! + */ static void au1k_wait(void) { - if (!allow_au1k_wait) - return; - - /* using the wait instruction makes CP0 counter unusable */ __asm__(" .set mips3 \n" " cache 0x14, 0(%0) \n" " cache 0x14, 32(%0) \n"