From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755249Ab0CVQlt (ORCPT ); Mon, 22 Mar 2010 12:41:49 -0400 Received: from f0.cmpxchg.org ([85.214.51.133]:36837 "EHLO cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755031Ab0CVQls (ORCPT ); Mon, 22 Mar 2010 12:41:48 -0400 Date: Mon, 22 Mar 2010 17:41:37 +0100 From: Johannes Weiner To: Thomas Gleixner Cc: Ivan Kokshaysky , john stultz , Richard Henderson , lkml , Matt Turner Subject: Re: [RFC][PATCH] Convert alpha to use clocksource Message-ID: <20100322164137.GA12625@cmpxchg.org> References: <1268877702-2236-1-git-send-email-johnstul@us.ibm.com> <4BA23974.5030503@twiddle.net> <1268934923.1855.8.camel@work-vm> <20100318214030.GA8934@jurassic.park.msu.ru> <20100322111744.GB10420@cmpxchg.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 22, 2010 at 03:22:12PM +0100, Thomas Gleixner wrote: > On Mon, 22 Mar 2010, Johannes Weiner wrote: > > > Though, even after a glance over the clocksource code, I've not > > > gotten yet to how one could estimate the "shift" value... > > > Any hints? > > > > I had the same problem with xtensa and added a comment about what I > > did in there, maybe it helps: > > > > arch/xtensa/kernel/time.c > > > > I took the upper bound of the multiplicator (nsecs per counter unit) > > and subtracted its logarithm from my available 32 bits. The result > > is the highest possible shift value that works for the clocksource. > > clocks_calc_mult_shift() is what you are looking for. Oh, thanks! That was not yet around at the time. Hannes