diff mbox

clocksource: SuperH TMU Timer driver

Message ID 4A3E11D6.5000402@juno.dti.ne.jp (mailing list archive)
State Accepted
Headers show

Commit Message

Shin-ichiro KAWASAKI June 21, 2009, 10:56 a.m. UTC
Magnus Damm wrote:
> On Fri, Jun 12, 2009 at 12:51 AM, Shin-ichiro
> KAWASAKI<kawasaki@juno.dti.ne.jp> 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 <kawasaki@juno.dti.ne.jp>

 drivers/clocksource/sh_tmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)



--
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

Comments

Magnus Damm June 24, 2009, 11:40 a.m. UTC | #1
On Sun, Jun 21, 2009 at 7:56 PM, Shin-ichiro
KAWASAKI<kawasaki@juno.dti.ne.jp> wrote:
> Avoid undocumented vague TMU behavior when zero value is set to TCOR.
>
> Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>

Seems to work just fine on my Migo-R board, thanks!

Acked-by: Magnus Damm <damm@igel.co.jp>
--
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
Paul Mundt June 24, 2009, 12:07 p.m. UTC | #2
On Wed, Jun 24, 2009 at 08:40:19PM +0900, Magnus Damm wrote:
> On Sun, Jun 21, 2009 at 7:56 PM, Shin-ichiro
> KAWASAKI<kawasaki@juno.dti.ne.jp> wrote:
> > Avoid undocumented vague TMU behavior when zero value is set to TCOR.
> >
> > Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
> 
> Seems to work just fine on my Migo-R board, thanks!
> 
> Acked-by: Magnus Damm <damm@igel.co.jp>

Applied, thanks.
--
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 mbox

Patch

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);