All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: danieljlaird@hotmail.com, linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: 2.6.19 timer API changes
Date: Wed, 20 Dec 2006 17:29:25 +0300	[thread overview]
Message-ID: <458948C5.4050909@ru.mvista.com> (raw)
In-Reply-To: <20061220.021508.97296486.anemo@mba.ocn.ne.jp>

Hello.

Atsushi Nemoto wrote:

>>I am just digging out the mips core user manual...  
>>However I have tried this change you suggested, it still takes a long time
>>to get past the calibrate delay function (~10seconds).
>>However after this it seems to run at full speed where as before it used to
>>run very slow.
>>So an improvement, I think this does mean the new time.c has broken 8550
>>support hopefully I can find otu what the core does so it can be fixed.

> Hm, then it seems writing to COMPARE does not clear COUNT.

    Looks like the count/compare match does this...

> How about this?  You should still fix pnx8550_hpt_read() anyway, but I
> suppose gettimeofday() on PNX8550 was broken long time.

    And nobody noticed. :-)

> Subject: [MIPS] Use custom timer_ack and clocksource_mips.read for PNX8550
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> ---
> diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
> index 11aab6d..8aa544f 100644
> --- a/arch/mips/kernel/time.c
> +++ b/arch/mips/kernel/time.c
> @@ -94,10 +94,8 @@ static void c0_timer_ack(void)
>  {
>  	unsigned int count;
>  
> -#ifndef CONFIG_SOC_PNX8550	/* pnx8550 resets to zero */
>  	/* Ack this timer interrupt and set the next one.  */
>  	expirelo += cycles_per_jiffy;
> -#endif
>  	write_c0_compare(expirelo);
>  
>  	/* Check to see if we have missed any timer interrupts.  */
> diff --git a/arch/mips/philips/pnx8550/common/time.c b/arch/mips/philips/pnx8550/common/time.c
> index 65c440e..e86905a 100644
> --- a/arch/mips/philips/pnx8550/common/time.c
> +++ b/arch/mips/philips/pnx8550/common/time.c
> @@ -33,7 +33,18 @@ #include <asm/debug.h>
>  #include <int.h>
>  #include <cm.h>

> -extern unsigned int mips_hpt_frequency;
> +static unsigned long cycles_per_jiffy __read_mostly;

   I wonder shouldn't it be added to <asm-mips/time.h> just for such occasions..

> +
> +static void pnx8550_timer_ack(void)
> +{
> +	write_c0_compare(cycles_per_jiffy);
> +}
> +
> +static cycle_t pnx8550_hpt_read(void)
> +{
> +	/* FIXME: we should use timer2 or timer3 as freerun counter */
> +	return read_c0_count();
 > +}

    I'd suggest read_c0_count2() here, possibly adding an interrupt handler 
for it since it will interrupt upon hitting compare2 reg. value (but we could 
probably just mask the IRQ off), and enabling the timer 2, of course (the 
current code disables it)...

WBR, Sergei

  parent reply	other threads:[~2006-12-20 14:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-18  9:15 2.6.19 timer API changes Daniel Laird
2006-12-19  8:17 ` Daniel Laird
2006-12-19 14:34   ` Atsushi Nemoto
2006-12-19 14:51     ` Daniel Laird
2006-12-19 16:23       ` Sergei Shtylyov
2006-12-19 15:01     ` Atsushi Nemoto
2006-12-19 15:34       ` Daniel Laird
2006-12-19 17:15         ` Atsushi Nemoto
2006-12-20  9:37           ` Daniel Laird
2006-12-20 14:12             ` Sergei Shtylyov
2006-12-20 14:50               ` Kevin D. Kissell
2006-12-20 14:50                 ` Kevin D. Kissell
2006-12-20 18:01                 ` Sergei Shtylyov
2006-12-20 15:24             ` Atsushi Nemoto
2006-12-20 15:46               ` Daniel Laird
2006-12-20 14:29           ` Sergei Shtylyov [this message]
2006-12-20 15:40             ` Atsushi Nemoto
2006-12-20 15:48               ` Daniel Laird
2006-12-20 15:48             ` Sergei Shtylyov
2006-12-19 15:52     ` Sergei Shtylyov
2006-12-19 16:29       ` Atsushi Nemoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=458948C5.4050909@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=danieljlaird@hotmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.