Skip to contentSkip to conversation

sparc32, leon: Remove separate "ticker" timer for SMP

PATCH Applied Andreas Larsson 2 participants 2 messages Jun 10, 2013 – Jun 19, 2013 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

Andreas Larsson

author maintainer
#0 lore raw

PATCH 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
index 15a7169..b836e92 100644
@@ -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
index f3034ed..24ec48c 100644
@@ -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
maintainer Applied
#1 lore raw

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_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.

Applied.