[PATCHv5 04/16] arm: arch_timer: standardise counter reading

Catalin Marinas catalin.marinas at arm.com
Thu Jan 31 10:34:55 EST 2013


On Thu, Jan 31, 2013 at 12:15:27PM +0000, Mark Rutland wrote:
> 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 at arm.com>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Marc Zyngier <marc.zyngier at arm.com>
> Cc: Santosh Shilimkar <santosh.shilimkar at ti.com>

Acked-by: Catalin Marinas <catalin.marinas at arm.com>



More information about the linux-arm-kernel mailing list