From patchwork Mon Aug 2 09:29:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 116473 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o729SY8p003650 for ; Mon, 2 Aug 2010 09:28:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753088Ab0HBJ2e (ORCPT ); Mon, 2 Aug 2010 05:28:34 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:53349 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752924Ab0HBJ2d (ORCPT ); Mon, 2 Aug 2010 05:28:33 -0400 Received: by pzk26 with SMTP id 26so1274781pzk.19 for ; Mon, 02 Aug 2010 02:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=9r0n+jpwYQs9xS+Amx675BoO3on9rgUUZ+k/1YgRQzI=; b=pfjpVoQIuNVywj1QHx0DanUsRGU9J+1ADN44CtCaK4PfuB6PLEyWcQeJAvwlmAx6or oiJpswjjGjM92bteX/zuR9gvJPnqCC2IUoljCcZYo7keB8vnBdCyRe4JxkBME/h7hHwD T/fYQguu0S17dwMUVr9M8UFDnF4Mpb+XPYKBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=WE/ZUbDG0hKPti+lkphJQJ6DVZRwVwB8ES+IDxg8MC4q7X3t49dw8PoeNkGc24SNTJ Kihty/XU6/A/jiULI+pdXzbeR5jQ1Sm6TDJo/6XAHpc8f4UGw0TpLeOBivgVD9RmlgWz fEZQL2l91rGJV5isZFP73E4rUcHXQ3GZkEWOs= Received: by 10.115.47.13 with SMTP id z13mr7090168waj.30.1280741313375; Mon, 02 Aug 2010 02:28:33 -0700 (PDT) Received: from [127.0.0.1] (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id q6sm11052524waj.10.2010.08.02.02.28.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Aug 2010 02:28:32 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: johnstul@us.ibm.com, Magnus Damm , lethal@linux-sh.org Date: Mon, 02 Aug 2010 18:29:30 +0900 Message-Id: <20100802092930.30883.59203.sendpatchset@t400s> Subject: [PATCH] clocksource: sh_cmt: One-off clockevent fix Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 02 Aug 2010 09:28:35 +0000 (UTC) --- 0006/drivers/clocksource/sh_cmt.c +++ work/drivers/clocksource/sh_cmt.c 2010-08-02 17:43:08.000000000 +0900 @@ -478,7 +478,7 @@ static void sh_cmt_clock_event_start(str ced->min_delta_ns = clockevent_delta2ns(0x1f, ced); if (periodic) - sh_cmt_set_next(p, (p->rate + HZ/2) / HZ); + sh_cmt_set_next(p, ((p->rate + HZ/2) / HZ) - 1); else sh_cmt_set_next(p, p->max_match_value); } @@ -523,9 +523,9 @@ static int sh_cmt_clock_event_next(unsig BUG_ON(ced->mode != CLOCK_EVT_MODE_ONESHOT); if (likely(p->flags & FLAG_IRQCONTEXT)) - p->next_match_value = delta; + p->next_match_value = delta - 1; else - sh_cmt_set_next(p, delta); + sh_cmt_set_next(p, delta - 1); return 0; }