From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753372AbZBTScR (ORCPT ); Fri, 20 Feb 2009 13:32:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755016AbZBTSb6 (ORCPT ); Fri, 20 Feb 2009 13:31:58 -0500 Received: from mx3.mail.elte.hu ([157.181.1.138]:33331 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754922AbZBTSb5 (ORCPT ); Fri, 20 Feb 2009 13:31:57 -0500 Date: Fri, 20 Feb 2009 19:31:30 +0100 From: Ingo Molnar To: Alok Kataria Cc: the arch/x86 maintainers , LKML , Zach Amsden , Andrew Morton Subject: Re: x86, vmi: TSC going backwards check in vmi clocksource Message-ID: <20090220183130.GA14849@elte.hu> References: <1234989235.7991.2.camel@alok-dev1> <20090220175841.GQ24538@elte.hu> <1235154198.1547.3.camel@alok-dev1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1235154198.1547.3.camel@alok-dev1> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Alok Kataria wrote: > On Fri, 2009-02-20 at 09:58 -0800, Ingo Molnar wrote: > > * Alok Kataria wrote: > > > > > static cycle_t read_real_cycles(void) > > > { > > > - return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL); > > > + cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL); > > > + return ret >= clocksource_vmi.cycle_last ? > > > + ret : clocksource_vmi.cycle_last; > > > > btw., could you please clean this up to use max()? > > Please find it below, on top of current tip/master. Applied to tip:x86/cleanups, thanks! Ingo