All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Laird <danieljlaird@hotmail.com>
To: linux-mips@linux-mips.org
Subject: Re: [PATCH][respin] pnx8550: fix system timer support
Date: Tue, 2 Jan 2007 06:05:55 -0800 (PST)	[thread overview]
Message-ID: <8124491.post@talk.nabble.com> (raw)
In-Reply-To: <acd2a5930612280820l43639382x1f573386f2752d18@mail.gmail.com>



Vitaly Wool-4 wrote:
> 
> On 12/28/06, Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
>>
>> On Thu, 28 Dec 2006 17:14:05 +0300, Vitaly Wool <vitalywool@gmail.com>
>> wrote:
>> > --- linux-mips.git.orig/arch/mips/philips/pnx8550/common/time.c
>> > +++ linux-mips.git/arch/mips/philips/pnx8550/common/time.c
>> > @@ -29,11 +29,22 @@
>> >  #include <asm/hardirq.h>
>> >  #include <asm/div64.h>
>> >  #include <asm/debug.h>
>> > +#include <asm/time.h>
>>
>> As I said before, asm/time.h is already included just before there.
>> Why double inclusion?
>>
>>
> Oh shoot, thanks, this hunk is bogus.
> 
> Vitaly
> 
> 
I have now tried this new patch and am still not having much success and am
still not understanding the patch very well.
First things first, if I do use the line 
clocksource_mips.read = hpt_read; 
It does not compile as this symbol is not in a header file and is a static
struct in arch/mips/kernel/time.c
I can make it not static and extern it from pnx8550/common/time.c is this
how I should do it?

Secondly I look at the logic for the arch/mips/kernel/time.c in the
time_init code
I think we want to follow the else branch (/* We know counter frequency.  Or
we can get it.  */)
In this case it then checks to see if mips_hpt_read is undefined which in
our case it is.
It then defines the mips_hpt_read to be c0_hpt_read

It then also overrides mips_timer_ack to be c0_timer_ack which i think is
wrong as we have already overridden this function in
arch/mips/philips/pnx8550/common/time.c.  (Is this behaviour correct?)

I used the patch and ran the kernel,  It does not work very well, Long Hang
after 
Memory: ......
Very slow behaviour after this.

I tried the following:
else {
    /* We know counter frequency.  Or we can get it.  */
    if (!mips_hpt_read) 
    {
        /* No external high precision timer -- use R4k.  */
	mips_hpt_read = c0_hpt_read;

	if (!mips_timer_state) {
            /* No external timer interrupt -- use R4k.  */
	    mips_hpt_init = c0_hpt_timer_init;
+	    if(!mips_timer_ack)
                mips_timer_ack = c0_timer_ack;
	}
}
This means it uses the mips_timer_ack function defined in
arch/mips/philips/pnx8550/common/time.c 
(mips_timer_ack = timer_ack;)

If I use this patch then the kernel still hangs for a long time at 
Memory: ...... (of the order of 12-14 secs)
It then seems to run at full speed and to a prompt.

In summary:
How do I override clocksource_mips.read properly?
Should mips_timer_ack = c0_timer_ack; be being done even though the board
specific mips_timer_ack = timer_ack; has been done?
Finally there is still the long hang which still looks top be related to
waiting for counter to cycle could ?

Any help with all three would be appreciated but 1 and 2 appear to be more
generic questions whilst 3 is PNX8550 specific (any help  would be
appreciated there as well).

Cheers
Dan




-- 
View this message in context: http://www.nabble.com/-PATCH--respin--pnx8550%3A-fix-system-timer-support-tf2890537.html#a8124491
Sent from the linux-mips main mailing list archive at Nabble.com.

  reply	other threads:[~2007-01-02 14:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-28 14:14 [PATCH][respin] pnx8550: fix system timer support Vitaly Wool
2006-12-28 16:16 ` Atsushi Nemoto
2006-12-28 16:20   ` Vitaly Wool
2007-01-02 14:05     ` Daniel Laird [this message]
2007-01-02 16:06       ` Atsushi Nemoto
2007-01-02 17:17         ` Daniel Laird
2007-01-03 13:37           ` Daniel Laird
2007-01-03 13:57           ` Atsushi Nemoto
2007-01-03 14:34             ` Daniel Laird

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=8124491.post@talk.nabble.com \
    --to=danieljlaird@hotmail.com \
    --cc=linux-mips@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.