linux/drivers/clocksource
Sonny Rao 0b46b8a718 clocksource: arch_timer: Fix code to use physical timers when requested
This is a bug fix for using physical arch timers when
the arch_timer_use_virtual boolean is false.  It restores the
arch_counter_get_cntpct() function after removal in

0d651e4e "clocksource: arch_timer: use virtual counters"

We need this on certain ARMv7 systems which are architected like this:

* The firmware doesn't know and doesn't care about hypervisor mode and
  we don't want to add the complexity of hypervisor there.

* The firmware isn't involved in SMP bringup or resume.

* The ARCH timer come up with an uninitialized offset between the
  virtual and physical counters.  Each core gets a different random
  offset.

* The device boots in "Secure SVC" mode.

* Nothing has touched the reset value of CNTHCTL.PL1PCEN or
  CNTHCTL.PL1PCTEN (both default to 1 at reset)

One example of such as system is RK3288 where it is much simpler to
use the physical counter since there's nobody managing the offset and
each time a core goes down and comes back up it will get reinitialized
to some other random value.

Fixes: 0d651e4e65 ("clocksource: arch_timer: use virtual counters")
Cc: stable@vger.kernel.org
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2014-12-04 23:30:26 -08:00
..
acpi_pm.c treewide: Fix printks with 0x%# 2013-08-27 10:49:38 +02:00
arm_arch_timer.c clocksource: arch_timer: Fix code to use physical timers when requested 2014-12-04 23:30:26 -08:00
arm_global_timer.c ARM: make it easier to check the CPU part number correctly 2014-07-18 12:29:02 +01:00
bcm2835_timer.c clocksource: bcm2835: Switch to sched_clock_register() 2013-07-30 11:24:51 -07:00
bcm_kona_timer.c clocksource: Kona: Print warning rather than panic 2014-02-06 16:01:40 +01:00
cadence_ttc_timer.c clocksource: cadence_ttc: Add support for 32bit mode 2014-09-29 01:59:09 +02:00
clksrc-dbx500-prcmu.c clocksource: dbx500-prcmu: Switch to sched_clock_register() 2013-07-30 11:24:52 -07:00
clksrc-of.c of: consolidate linker section OF match table declarations 2014-05-20 14:25:24 -05:00
clps711x-timer.c clocksource: clps711x: Add CLPS711X clocksource driver 2014-07-23 12:02:35 +02:00
cs5535-clockevt.c clocksource: misc drivers: Remove deprecated IRQF_DISABLED 2013-12-11 11:40:27 +01:00
dummy_timer.c time: Replace __get_cpu_var uses 2014-08-26 13:45:44 -04:00
dw_apb_timer_of.c clocksource: dw_apb_timer_of: Do not trace read_sched_clock 2014-05-23 09:23:09 +02:00
dw_apb_timer.c clocksource: misc drivers: Remove deprecated IRQF_DISABLED 2013-12-11 11:40:27 +01:00
em_sti.c clocksource: em_sti: Remove unnecessary OOM messages 2014-05-23 09:23:10 +02:00
exynos_mct.c clocksource: exynos_mct: Only use 32-bits where possible 2014-07-23 12:02:41 +02:00
fsl_ftm_timer.c clocksource: Add Freescale FlexTimer Module (FTM) timer support 2014-05-23 10:12:04 +02:00
i8253.c time: Kill xtime_lock, replacing it with jiffies_lock 2012-11-13 14:08:23 -05:00
Kconfig Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-10-09 06:35:05 -04:00
Makefile Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-10-09 06:35:05 -04:00
meson6_timer.c ARM: meson6: clocksource: Add Meson6 timer support 2014-09-29 01:50:05 +02:00
metag_generic.c drivers/clocksource: Replace __get_cpu_var used for address calculation 2014-08-26 13:45:46 -04:00
mmio.c clocksource: Fix clocksource_mmio_readX_down 2014-05-23 09:19:40 +02:00
moxart_timer.c ARM: clocksource: moxart: Add bitops.h include 2013-08-01 01:13:34 +02:00
mtk_timer.c clocksource: Add support for the Mediatek SoCs 2014-07-23 12:02:31 +02:00
mxs_timer.c clocksource: mxs_timer: Switch to sched_clock_register() 2013-07-30 11:24:52 -07:00
nomadik-mtu.c ARM: SoC DT updates for 3.14 2014-01-23 18:45:38 -08:00
pxa_timer.c clocksource: pxa: Add device-tree support for PXA timer 2014-07-23 12:02:37 +02:00
qcom-timer.c clocksource: Replace __this_cpu_ptr with raw_cpu_ptr 2014-08-26 13:45:56 -04:00
samsung_pwm_timer.c clocksource: misc drivers: Remove deprecated IRQF_DISABLED 2013-12-11 11:40:27 +01:00
scx200_hrt.c clocksource: scx200_hrt: Fix the build 2012-02-22 13:25:16 +01:00
sh_cmt.c clocksource: sh_cmt: Add DT support 2014-07-04 15:46:17 +02:00
sh_mtu2.c clocksource: sh_mtu2: Add DT support 2014-07-04 15:50:29 +02:00
sh_tmu.c clocksource: sh_tmu: Add DT support 2014-07-04 15:50:28 +02:00
sun4i_timer.c clocksource: sunxi: Add new compatibles 2014-03-11 23:04:46 +01:00
tcb_clksrc.c clocksource: tcb_clksrc: Sanitize IRQ request 2014-09-29 01:50:05 +02:00
tegra20_timer.c clocksource: tegra: Use us counter as delay timer 2014-06-16 12:48:12 -06:00
time-armada-370-xp.c clocksource: armada-370-xp: Use atomic access for shared registers 2014-03-11 23:05:05 +01:00
time-efm32.c clocksource: efm32: use $vendor,$device scheme for compatible string 2014-04-22 11:44:28 +02:00
time-orion.c clocksource: orion: Use atomic access for shared registers 2014-03-11 23:05:02 +01:00
timer-atmel-pit.c ARM: at91: PIT: Move the driver to drivers/clocksource 2014-09-15 17:55:48 +02:00
timer-keystone.c clocksource: timer-keystone: Delete unnecessary variable 2014-03-11 23:05:00 +01:00
timer-marco.c clocksource: sirf: Disable counter before re-setting it 2014-09-29 01:59:24 +02:00
timer-prima2.c clocksource: sirf: Fix incorrect clock enable counter for timer 2014-07-23 12:02:34 +02:00
timer-sun5i.c clocksource: sun5i: Add support for reset controller 2014-04-22 13:56:50 +02:00
timer-u300.c Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2014-04-05 13:20:43 -07:00
versatile.c clocksource: versatile: Use sched_clock_register() 2014-06-04 07:46:10 -07:00
vf_pit_timer.c clocksource: vf_pit_timer: Support shutdown mode 2014-09-29 01:50:05 +02:00
vt8500_timer.c clocksource: vt8500: Remove deprecated IRQF_DISABLED 2013-12-11 11:40:28 +01:00
zevio-timer.c clocksource: nspire: Fix compiler warning 2014-04-29 15:06:43 +02:00