[PATCHv4 4/4] clocksource: dw_apb_timer_of: Fix read_sched_clock

Linus Walleij linus.walleij at linaro.org
Fri Aug 23 14:07:56 EDT 2013

On Thu, Aug 22, 2013 at 6:30 PM,  <dinguyen at altera.com> wrote:

> From: Dinh Nguyen <dinguyen at altera.com>
> The read_sched_clock should return the ~value because the clock is a
> countdown implementation. read_sched_clock() should be the same as
> __apbt_read_clocksource().
> If a separate timer for the sched_clock exist, then read_sched_clock()
> will return an incorrect value. The (sched_io_base + 0x4) needs to be in
> the function for both cases.
> Maintain backwards compatibility for "dw-apb-timer-sp" and
> "dw-apb-timer-osc".
> Signed-off-by: Dinh Nguyen <dinguyen at altera.com>
> Acked-by: Jamie Iles <jamie at jamieiles.com>
> CC: Rob Herring <rob.herring at calxeda.com>
> CC: Arnd Bergmann <arnd at arndb.de>
> Cc: Olof Johansson <olof at lixom.net>
> CC: Jamie Iles <jamie at jamieiles.com>
> Cc: John Stultz <john.stultz at linaro.org>
> Cc: Daniel Lezcano <daniel.lezcano at linaro.org>
> Cc: Thomas Gleixner <tglx at linutronix.de>
> Cc: Linus Walleij <linus.walleij at linaro.org>
> Cc: Pavel Machek <pavel at denx.de>
> Cc: Heiko Stuebner <heiko at sntech.de>
> Cc: linux-arm-kernel at lists.infradead.org
> v3:
> - Use APBTMR_N_CURRENT_VALUE define in read_sched_clock()

Acked-by: Linus Walleij <linus.walleij at linaro.org>

Linus Walleij

More information about the linux-arm-kernel mailing list