]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00176278 mx6: make local timer work with WAIT mode
authorXinyu Chen <b03824@freescale.com>
Wed, 7 Mar 2012 02:17:21 +0000 (10:17 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:11:46 +0000 (14:11 +0200)
commit31bdc354d821a74c2c2d175200e3f33841c37e9c
treecdda86f16cce2d22630d70f06029792dd5a8c59b
parentbbb03a8cd7aa47cb8d0373674da20ffad2dfc68c
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>
arch/arm/mach-mx6/localtimer.c
arch/arm/mach-mx6/system.c
arch/arm/plat-mxc/time.c