From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932175Ab0HXV6M (ORCPT ); Tue, 24 Aug 2010 17:58:12 -0400 Received: from smtp-outbound-2.vmware.com ([65.115.85.73]:7773 "EHLO smtp-outbound-2.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932093Ab0HXV6L (ORCPT ); Tue, 24 Aug 2010 17:58:11 -0400 Subject: Re: [PATCH] x86, apic: Add apic calibration hook. From: Alok Kataria Reply-To: akataria@vmware.com To: Thomas Gleixner Cc: "H. Peter Anvin" , the arch/x86 maintainers , LKML In-Reply-To: References: <1282153304.15158.39.camel@ank32.eng.vmware.com> <1282159660.15158.56.camel@ank32.eng.vmware.com> <1282669564.24498.2.camel@ank32.eng.vmware.com> Content-Type: text/plain Organization: VMware INC. Date: Tue, 24 Aug 2010 14:58:10 -0700 Message-Id: <1282687090.24498.30.camel@ank32.eng.vmware.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-8.el5_2.3) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2010-08-24 at 14:51 -0700, Thomas Gleixner wrote: > Alok, > > On Tue, 24 Aug 2010, Alok Kataria wrote: > > > Hi Thomas, > > > > Thanks for taking a look. > > > > On Tue, 2010-08-24 at 06:37 -0700, Thomas Gleixner wrote: > > > On Wed, 18 Aug 2010, Alok Kataria wrote: > > > > > > > > +static void __init initialize_lapic_clkevt(long delta) > > > > +{ > > > > + /* Calculate the scaled math multiplication factor */ > > > > + lapic_clockevent.mult = div_sc(delta, TICK_NSEC * LAPIC_CAL_LOOPS, > > > > + lapic_clockevent.shift); > > > > + lapic_clockevent.max_delta_ns = > > > > + clockevent_delta2ns(0x7FFFFF, &lapic_clockevent); > > > > + lapic_clockevent.min_delta_ns = > > > > + clockevent_delta2ns(0xF, &lapic_clockevent); > > > > +} > > > > + > > > > static int __init calibrate_APIC_clock(void) > > > > { > > > > + apic_calibration_res = x86_init.timers.calibrate_apic(); > > > > + if (apic_calibration_res) { > > > > + struct clock_event_device *levt = &__get_cpu_var(lapic_events); > > > > + long delta; > > > > + > > > > + if (lapic_clockevent.mult) > > > > + return 0; > > > > > > Why is this necessary ? calibrate_APIC_clock() is only called once. > > > > > > > Yes, though timer.calibrate_apci() could behave differently on different > > platforms. For eg. the vmware_calibrate_apic doesn't initialize any of > > the lapic_clockevent state and we need this to set it up in that case. > > Can we please make this consistent ? Let me rework this patch and get back in a day or two. Thanks, Alok > > Thanks, > > tglx