summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx6/localtimer.c
diff options
context:
space:
mode:
authorXinyu Chen <b03824@freescale.com>2012-03-07 10:17:21 +0800
committerXinyu Chen <b03824@freescale.com>2012-03-07 12:19:38 +0800
commite0d326dc30f031bb7807d8c916bff0ec313f41f3 (patch)
treef4ca4e07ec407d58da0609cfcf560338b389e2b6 /arch/arm/mach-mx6/localtimer.c
parentb69b4f6a2dcda6e95a4dbaca2c625aeb4c0bfbbd (diff)
ENGR00176278 mx6: make local timer work with WAIT mode
As mx6q soc use one clock to provide for cpu and local timer, the local timers will be stopped when enter wait mode. This causes system hang when enter wait mode with local timer enabled. So we should switch the clock event to GPT broadcast clock event before entering wait mode, and disable local timers. Todo this, following changes made: * In arch_idle(), we check if the GPT broadcast clock event is switched to one shot mode. If the kernel clocksource is switched from jiffies one to GPT, then we can use GPT as broadcast event. And switch from local timer to GPT broadcast event before entering mx6q_wait. Otherwise, kernel will hange if the SW jiffies clock source is used. We call clockevents_notify to switch clock source. * Remove the enable_wait_mode check in local timer setup. * Always return 0 in GPT v2 timer's set_next_event routing. All the GPTs are running in free run mode as what driver did. So we should allow the GPT CNT register roll over to 0 when it reaches 0xFFFFFFFF. And the next event written to compare register can less than the current value in CNT. If we refused to do roll over settings, the kernel will continues to set_next_event to GPT when the next event is far away and we return negative value. This is happend when one CPU is in idle and no timewheel is being expired in short time. Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx6/localtimer.c')
-rw-r--r--arch/arm/mach-mx6/localtimer.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/arm/mach-mx6/localtimer.c b/arch/arm/mach-mx6/localtimer.c
index b8bfdaba0de1..402368b0cc8a 100644
--- a/arch/arm/mach-mx6/localtimer.c
+++ b/arch/arm/mach-mx6/localtimer.c
@@ -31,12 +31,7 @@ extern bool enable_wait_mode;
*/
int __cpuinit local_timer_setup(struct clock_event_device *evt)
{
-#ifdef CONFIG_LOCAL_TIMERS
- if (!enable_wait_mode) {
- evt->irq = IRQ_LOCALTIMER;
- twd_timer_setup(evt);
- return 0;
- }
-#endif
- return -1;
+ evt->irq = IRQ_LOCALTIMER;
+ twd_timer_setup(evt);
+ return 0;
}