aboutsummaryrefslogtreecommitdiff
path: root/drivers/clocksource/arm_arch_timer.c
AgeCommit message (Collapse)AuthorFilesLines
2013-06-07clocksource: arch_timer: use virtual countersMark Rutland1-18/+5
Switching between reading the virtual or physical counters is problematic, as some core code wants a view of time before we're fully set up. Using a function pointer and switching the source after the first read can make time appear to go backwards, and having a check in the read function is an unfortunate block on what we want to be a fast path. Instead, this patch makes us always use the virtual counters. If we're a guest, or don't have hyp mode, we'll use the virtual timers, and as such don't care about CNTVOFF as long as it doesn't change in such a way as to make time appear to travel backwards. As the guest will use the virtual timers, a (potential) KVM host must use the physical timers (which can wake up the host even if they fire while a guest is executing), and hence a host must have CNTVOFF set to zero so as to have a consistent view of time between the physical timers and virtual counters. Signed-off-by: Mark Rutland <[email protected]> Acked-by: Catalin Marinas <[email protected]> Acked-by: Marc Zyngier <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Cc: Rob Herring <[email protected]>
2013-04-26ARM: arch_timer: Silence debug preempt warningsStephen Boyd1-4/+6
Hot-plugging with CONFIG_DEBUG_PREEMPT=y on a device with arm architected timers causes a slew of "using smp_processor_id() in preemptible" warnings: BUG: using smp_processor_id() in preemptible [00000000] code: sh/111 caller is arch_timer_cpu_notify+0x14/0xc8 This happens because sometimes the cpu notifier, arch_timer_cpu_notify(), is called in preemptible context and other times in non-preemptible context but we use this_cpu_ptr() to retrieve the clockevent in all cases. We're only going to actually use the pointer in non-preemptible context though, so push the this_cpu_ptr() access down into the cases to force the checks to occur only in non-preemptible contexts. Cc: John Stultz <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Mark Rutland <[email protected]> Acked-by: Marc Zyngier <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Olof Johansson <[email protected]>
2013-04-11ARM: convert arm/arm64 arch timer to use CLKSRC_OF initRob Herring1-14/+9
This converts arm and arm64 to use CLKSRC_OF DT based initialization for the arch timer. A new function arch_timer_arch_init is added to allow for arch specific setup. This has a side effect of enabling sched_clock on omap5 and exynos5. There should not be any reason not to use the arch timers for sched_clock. Signed-off-by: Rob Herring <[email protected]> Cc: Russell King <[email protected]> Cc: Kukjin Kim <[email protected]> Cc: Tony Lindgren <[email protected]> Cc: Simon Horman <[email protected]> Cc: Magnus Damm <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: John Stultz <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Santosh Shilimkar <[email protected]>
2013-01-31ARM: arch_timers: switch to physical timers if HYP mode is availableMarc Zyngier1-1/+6
If we're booted in HYP mode, it is possible that we'll run some kind of virtualized environment. In this case, it is a better to switch to the physical timers, and leave the virtual timers to guests. Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Mark Rutland <[email protected]> Acked-by: Catalin Marinas <[email protected]>
2013-01-31arm64: move from arm_generic to arm_arch_timerMark Rutland1-0/+1
The arch_timer driver supports a superset of the functionality of the arm_generic driver, and is not tied to a particular arch. This patch moves arm64 to use the arch_timer driver, gaining additional functionality in doing so, and removes the (now unused) arm_generic driver. Timer-related hooks specific to arm64 are moved into arch/arm64/kernel/time.c. Signed-off-by: Mark Rutland <[email protected]> Acked-by: Catalin Marinas <[email protected]> Acked-by: Marc Zyngier <[email protected]> Acked-by: Santosh Shilimkar <[email protected]>
2013-01-31arm: arch_timer: move core to drivers/clocksourceMark Rutland1-0/+385
The core functionality of the arch_timer driver is not directly tied to anything under arch/arm, and can be split out. This patch factors out the core of the arch_timer driver, so it can be shared with other architectures. A couple of functions are added so that architecture-specific code can interact with the driver without needing to touch its internals. The ARM_ARCH_TIMER config variable is moved out to drivers/clocksource/Kconfig, existing uses in arch/arm are replaced with HAVE_ARM_ARCH_TIMER, which selects it. Signed-off-by: Mark Rutland <[email protected]> Acked-by: Catalin Marinas <[email protected]> Acked-by: Marc Zyngier <[email protected]>