Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753396AbcKSQSw (ORCPT ); Sat, 19 Nov 2016 11:18:52 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34757 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753128AbcKSQSt (ORCPT ); Sat, 19 Nov 2016 11:18:49 -0500 From: Nicolai Stange To: Thomas Gleixner Cc: John Stultz , linux-kernel@vger.kernel.org, Nicolai Stange Subject: [RFC v8 10/28] arch/tile/kernel/time: set ->min_delta_ticks and ->max_delta_ticks Date: Sat, 19 Nov 2016 17:00:37 +0100 Message-Id: <20161119160055.12491-11-nicstange@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161119160055.12491-1-nicstange@gmail.com> References: <20161119160055.12491-1-nicstange@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1506 Lines: 45 With the yet to come introduction of NTP correction awareness to the clockevent core, drivers should report their valid ranges in units of cycles to the latter. Currently, the tile's timer clockevent device is initialized as follows: evt->max_delta_ns = clockevent_delta2ns(MAX_TICK, evt); and .min_delta_ns = 1000, The first one translates to a ->max_delta_ticks value of MAX_TICK. For the latter, note that the clockevent core will superimpose a minimum of 1us by itself -- setting ->min_delta_ticks to 1 is safe here. Initialize ->min_delta_ticks and ->max_delta_ticks with these values. Signed-off-by: Nicolai Stange --- arch/tile/kernel/time.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/tile/kernel/time.c b/arch/tile/kernel/time.c index 178989e..c2fd280 100644 --- a/arch/tile/kernel/time.c +++ b/arch/tile/kernel/time.c @@ -154,6 +154,7 @@ static DEFINE_PER_CPU(struct clock_event_device, tile_timer) = { .name = "tile timer", .features = CLOCK_EVT_FEAT_ONESHOT, .min_delta_ns = 1000, + .min_delta_ticks = 1, .rating = 100, .irq = -1, .set_next_event = tile_timer_set_next_event, @@ -169,6 +170,7 @@ void setup_tile_timer(void) /* Fill in fields that are speed-specific. */ clockevents_calc_mult_shift(evt, cycles_per_sec, TILE_MINSEC); evt->max_delta_ns = clockevent_delta2ns(MAX_TICK, evt); + evt->max_delta_ticks = MAX_TICK; /* Mark as being for this cpu only. */ evt->cpumask = cpumask_of(smp_processor_id()); -- 2.10.2