Re: [GIT PULL RESEND] clocksource/clockevents fixes for 3.13

From: Ingo Molnar
Date: Tue Dec 10 2013 - 08:41:45 EST



* Daniel Lezcano <daniel.lezcano@xxxxxxxxxx> wrote:

>
> Hi Thomas, Ingo,
>
> here are the fixes for 3.13 based on timers/urgent
>
> * Axel Lin added a missing dependency on CLKSRC_MMIO in the Kconfig
> for the time-efm32.
>
> * Dinh Nguyen fixed read_sched_clock to return the right value for
> the dw_apb_timer.
>
> * Ezequiel Garcia registered the sched clock after the counter,
> thus preventing time jump in the traces for the armada-370-xp.
>
> * Marc Zyngier stopped the timer before enabling the irq in order
> to prevent it to be fired before the clockevent is registered for
> the sunxi.
>
> * Thierry Reding removed a of_node_put in clksrc-of because the
> reference is not held.

(For future reference, please post all patches not just a combo
patch.)

> Dinh Nguyen (2):
> clocksource: dw_apb_timer: Move timer defines to header file.
> clocksource: dw_apb_timer_of: Fix read_sched_clock

Nit: we generally don't use periods at the end of titles, it looks
inconsistent in shortlogs.

> diff --git a/drivers/clocksource/dw_apb_timer.c
> b/drivers/clocksource/dw_apb_timer.c
> index e54ca10..c3a8f52 100644
> --- a/drivers/clocksource/dw_apb_timer.c
> +++ b/drivers/clocksource/dw_apb_timer.c
> @@ -18,25 +18,6 @@
> #include <linux/io.h>
> #include <linux/slab.h>
>
> -#define APBT_MIN_PERIOD 4
> -#define APBT_MIN_DELTA_USEC 200
> -
> -#define APBTMR_N_LOAD_COUNT 0x00
> -#define APBTMR_N_CURRENT_VALUE 0x04
> -#define APBTMR_N_CONTROL 0x08
> -#define APBTMR_N_EOI 0x0c
> -#define APBTMR_N_INT_STATUS 0x10
> -
> -#define APBTMRS_INT_STATUS 0xa0
> -#define APBTMRS_EOI 0xa4
> -#define APBTMRS_RAW_INT_STATUS 0xa8
> -#define APBTMRS_COMP_VERSION 0xac
> -
> -#define APBTMR_CONTROL_ENABLE (1 << 0)
> -/* 1: periodic, 0:free running. */
> -#define APBTMR_CONTROL_MODE_PERIODIC (1 << 1)
> -#define APBTMR_CONTROL_INT (1 << 2)
> -
> static inline struct dw_apb_clock_event_device *
> ced_to_dw_apb_ced(struct clock_event_device *evt)
> {
> diff --git a/drivers/clocksource/dw_apb_timer_of.c
> b/drivers/clocksource/dw_apb_timer_of.c
> index 45ba8ae..c3fe17e 100644
> --- a/drivers/clocksource/dw_apb_timer_of.c
> +++ b/drivers/clocksource/dw_apb_timer_of.c
> @@ -102,18 +102,17 @@ static void __init add_clocksource(struct
> device_node *source_timer)
> * timer is found. sched_io_base then points to the current_value
> * register of the clocksource timer.
> */
> - sched_io_base = iobase + 0x04;
> + sched_io_base = iobase;
> sched_rate = rate;
> }
>
> static u64 read_sched_clock(void)
> {
> - return __raw_readl(sched_io_base);
> + return ~__raw_readl(sched_io_base + APBTMR_N_CURRENT_VALUE);

AFAICS the minimal fix here for v3.13 would be to just do:

> - return __raw_readl(sched_io_base);
> + return ~__raw_readl(sched_io_base);

Right? That way the fix is just a oneliner and we could delay the
header file and magic-constants use cleanups to v3.14.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/