From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753248Ab3LJNlk (ORCPT ); Tue, 10 Dec 2013 08:41:40 -0500 Received: from mail-ee0-f54.google.com ([74.125.83.54]:39136 "EHLO mail-ee0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631Ab3LJNli (ORCPT ); Tue, 10 Dec 2013 08:41:38 -0500 Date: Tue, 10 Dec 2013 14:41:33 +0100 From: Ingo Molnar To: Daniel Lezcano Cc: Thomas Gleixner , Axel Lin , Dinh Nguyen , Ezequiel Garcia , Marc Zyngier , Thierry Reding , Linux Kernel Mailing List Subject: Re: [GIT PULL RESEND] clocksource/clockevents fixes for 3.13 Message-ID: <20131210134133.GC31366@gmail.com> References: <52A716E0.4080103@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52A716E0.4080103@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Daniel Lezcano 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 > #include > > -#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