From patchwork Sun Jun 21 10:56:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin-ichiro KAWASAKI X-Patchwork-Id: 31643 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5LAv2f5010671 for ; Sun, 21 Jun 2009 10:57:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752469AbZFUK4W (ORCPT ); Sun, 21 Jun 2009 06:56:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753328AbZFUK4W (ORCPT ); Sun, 21 Jun 2009 06:56:22 -0400 Received: from vsmtp02.dti.ne.jp ([202.216.231.137]:33776 "EHLO vsmtp02.dti.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752469AbZFUK4W (ORCPT ); Sun, 21 Jun 2009 06:56:22 -0400 Received: from [192.168.1.20] (PPPa465.e11.eacc.dti.ne.jp [124.255.87.213]) by vsmtp02.dti.ne.jp (3.11v) with ESMTP AUTH id n5LAuLDp005221; Sun, 21 Jun 2009 19:56:21 +0900 (JST) Message-ID: <4A3E11D6.5000402@juno.dti.ne.jp> Date: Sun, 21 Jun 2009 19:56:22 +0900 From: Shin-ichiro KAWASAKI User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Magnus Damm CC: Paul Mundt , linux-sh@vger.kernel.org Subject: Re: [PATCH] clocksource: SuperH TMU Timer driver References: <20090501065100.8800.99808.sendpatchset@rx1.opensource.se> <4A213434.4030800@juno.dti.ne.jp> <20090601105747.GA32746@linux-sh.org> <4A24583B.2070604@juno.dti.ne.jp> <4A31280E.3020601@juno.dti.ne.jp> In-Reply-To: Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Magnus Damm wrote: > On Fri, Jun 12, 2009 at 12:51 AM, Shin-ichiro > KAWASAKI wrote: >> Here's the patch which suggests TMU driver modification. >> >> It does, >> - Sets maximum value 0xffffffff to TCOR instead of zero. > > I agree with this change, but I have not tested it yet. > >> Then after one shot interrupt, next count down runs >> for a while (around seconds?) >> - Stops the timer in the one shot interrupt handler. >> Then next count down does not reach to zero. > > I think disabling the interrupt should be enough, isn't that done with > TCR already? > >> This patch assumes that while TMU counting down from 0xffffffff, >> the interrupt handler finishes the task to stop the timer. >> >> I confirmed that the timer warnings from qemu-sh disappear >> with this patch. No test is done with real hardware. >> >> I'm not familiar with linux clock framework. >> Any comments are welcome. > > Is the TCOR change by itself enough to make QEMU happy? I hope so. Yes. As you pointed out, interrupt disabling by TCR is enough for QEMU. Here's the new simple one line patch. I've confirmed that this patch vanishes warnings from QEMU, but I've not yet tried it on real boards. Regards, Shin-ichioro KAWASAKI Avoid undocumented vague TMU behavior when zero value is set to TCOR. Signed-off-by: Shin-ichiro KAWASAKI drivers/clocksource/sh_tmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Acked-by: Magnus Damm --- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index d6ea439..84cc48e 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c @@ -158,7 +158,7 @@ static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta, if (periodic) sh_tmu_write(p, TCOR, delta); else - sh_tmu_write(p, TCOR, 0); + sh_tmu_write(p, TCOR, 0xffffffff); sh_tmu_write(p, TCNT, delta);