sparc32, leon: Remove separate "ticker" timer for SMP
Andreas Larsson
maintainerPATCH 1/1 sparc32, leon: Remove separate "ticker" timer for SMP
This reduces the need from two timers to one timer.
Moreover, without this patch, when the "ticker" timer triggers timer_cs_read via tick_periodic it reads the value of the usual timer it can get an wrapped timer value without timer_cs_internal_counter having been updated leading to the clock going backwards. This effectively hangs one cpu that gets stuck in update_wall_time with an offset slightly smaller than 0xffffffffffffffff.
--- arch/sparc/include/asm/leon.h | 2 +- arch/sparc/include/asm/leon_amba.h | 1 + arch/sparc/kernel/leon_kernel.c | 54 ++++++++++++------------------------ 3 files changed, 19 insertions(+), 38 deletions(-)
arch/sparc/include/asm/leon.h +1 -1
@@ -135,7 +135,7 @@ static inline int sparc_leon3_cpuid(void)#ifdef CONFIG_SMP # define LEON3_IRQ_IPI_DEFAULT 13 -# define LEON3_IRQ_TICKER (leon3_ticker_irq) +# define LEON3_IRQ_TICKER (leon3_gptimer_irq)# define LEON3_IRQ_CROSS_CALL 15#endif
arch/sparc/include/asm/leon_amba.h +1 -0
@@ -47,6 +47,7 @@ struct amba_prom_registers {#define LEON3_GPTIMER_LD 4#define LEON3_GPTIMER_IRQEN 8#define LEON3_GPTIMER_SEPIRQ 8 +#define LEON3_GPTIMER_TIMERS 0x7#define LEON23_REG_TIMER_CONTROL_EN 0x00000001/* 1 = enable counting */ /* 0 = hold scalar and counter */
arch/sparc/kernel/leon_kernel.c +17 -37
102 lines not on this page · raw message
Signature · 1 line
1.7.10.4
From: Andreas Larsson <[email protected]>
Date: Mon, 10 Jun 2013 08:53:28 +0200
Quoted 9 lines
This reduces the need from two timers to one timer.
Moreover, without this patch, when the "ticker" timer triggers
timer_cs_readviatick_periodicit reads the value of the usual timer it can get an wrapped timer value withouttimer_cs_internal_counterhaving been updated leading to the clock going backwards. This effectively hangs one cpu that gets stuck inupdate_wall_timewith an offset slightly smaller than0xffffffffffffffff.Signed-off-by Andreas Larsson <[email protected]>
Applied.