]> rtime.felk.cvut.cz Git - linux-imx.git/commit
arm: arch_timer: standardise counter reading
authorMark Rutland <mark.rutland@arm.com>
Wed, 14 Nov 2012 09:50:19 +0000 (09:50 +0000)
committerMark Rutland <mark.rutland@arm.com>
Thu, 31 Jan 2013 15:51:06 +0000 (15:51 +0000)
commitb8e243431fa11f542a0fd94e939543bcb7d236ee
tree12dc92819adc89656a74e08d137d9e1bb88c4a6a
parentef01c1d1483d214357f183949bc6173f29906a87
arm: arch_timer: standardise counter reading

We're currently inconsistent with respect to our accesses to the
physical and virtual counters, mixing and matching the two.

This patch introduces and uses a function pointer for accessing the
correct counter based on whether we're using physical or virtual
interrupts. All current accesses to the counter accessors are redirected
through it.

When the driver is moved out to drivers/clocksource, there's the
possibility that code called before the timer code is initialised will
attempt to call arch_timer_read_counter (e.g. sched_clock for AArch64).
To avoid having to have to check whether the timer has been initialised
either in arch_timer_read_counter or one of it's callers, a default
implementation is assigned that simply returns 0.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
arch/arm/kernel/arch_timer.c