From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755456AbZBDLj5 (ORCPT ); Wed, 4 Feb 2009 06:39:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751057AbZBDLjt (ORCPT ); Wed, 4 Feb 2009 06:39:49 -0500 Received: from fg-out-1718.google.com ([72.14.220.156]:23748 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750837AbZBDLjt (ORCPT ); Wed, 4 Feb 2009 06:39:49 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:message-id:from:to:cc:subject:in-reply-to:references :user-agent:mime-version:content-type; b=kmw1BDOzZEvzUELhVCtZKh2pSpNgMxFYlrVWPL59Plf1jU74Dva9aCNP9qbufcu7Zd 9MbCuXbvcHnLYXdLN6I1nO0qfrUgwzq/0JRsmFi2y97wfRaPxvikZ2X06Nm5XL+JgL+b xRzzW1iWS4lPyYb8RL6vPKAfWJkVY8fxxXxQQ= Date: Wed, 04 Feb 2009 12:39:48 +0100 Message-ID: From: Vitaly Mayatskikh To: Pavel Emelyanov Cc: Thomas Gleixner , Linux Kernel Mailing List , Kirill Korotaev Subject: Re: [PATCH] x86: fix hpet timer reinit for x86_64 In-Reply-To: <4989709F.1050207@openvz.org> References: <4989709F.1050207@openvz.org> User-Agent: Wanderlust/2.15.6 (Almost Unreal) Emacs/22.2 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Wed, 04 Feb 2009 13:40:31 +0300, Pavel Emelyanov wrote: > > There's a small problem with hpet_rtc_reinit function - it checks > for the > hpet_readl(HPET_COUNTER) - hpet_t1_cmp > 0 > to continue increasing both the HPET_T1_CMP (register) and the > hpet_t1_cmp (variable). > > But since the HPET_COUNTER is always 32-bit, if the hpet_t1_cmp > is 64-bit this condition will always be FALSE once the latter hits > the 32-bit boundary, and we can have a situation, when we don't > increase the HPET_T1_CMP register high enough. > > The result - timer stops ticking, since HPET_T1_CMP becomes less, > than the COUNTER and never increased again. > > The solution is to cut the upper 32-bit from the hpet_t1_cmp > variable to make the comparison to HPET_COUNTER correct. Why not to use u32 as a type for hpet_t1_cmp then? -- wbr, Vitaly