linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Hannemann <hannemann@i4.informatik.rwth-aachen.de>
To: Jordan Crouse <jordan.crouse@amd.com>
Cc: Andres Salomon <dilinger@queued.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.24-rc8 hangs at mfgpt-timer
Date: Thu, 17 Jan 2008 22:50:46 +0100	[thread overview]
Message-ID: <478FCDB6.4010708@i4.informatik.rwth-aachen.de> (raw)
In-Reply-To: <20080117211917.GF8244@cosmic.amd.com>

Jordan Crouse schrieb:
> On 17/01/08 20:53 +0100, Arnd Hannemann wrote:
>> Andres Salomon schrieb:
>>> On Thu, 17 Jan 2008 10:54:30 +0100
>>> Arnd Hannemann <hannemann@i4.informatik.rwth-aachen.de> wrote:
>>>
>>>> Andres Salomon schrieb:
>>>>> On Wed, 16 Jan 2008 16:19:12 -0500
>>>>> Andres Salomon <dilinger@queued.net> wrote:
>>>>>
>>>>>> On Wed, 16 Jan 2008 18:44:07 +0100
>>>>>> Arnd Hannemann <hannemann@i4.informatik.rwth-aachen.de> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm trying to boot 2.6.24-rc8 on a GEODE LX board (ALIX.3),
>>>>>>> and it hangs during boot:
>>>>>>>
>>>>>>> [   12.689971] NET: Registered protocol family 16
>>>>>>> [   12.703329] geode-mfgpt:  Registered timer 0
>>>>>>> [   12.716149] mfgpt-timer:  registering the MFGT timer as a clock event...
>>>>>>>
>>>>>> What BIOS are you using?  It's possible that our detection code is
>>>>>> failing to detect in-use timers.
>>>> I'm using v0.99 (latest available).
>>>
>>> v0.99 of what?  Jordan seems to think it's an Award BIOS, but I'd like
>>> to make sure.
>> Its an ALIX board from PCEngines, they have their own BIOS
>> implementation (tinyBios).
>> http://www.pcengines.ch/alix.htm
>>
>>>> Also note when I do enable the mysterios "MFGPT workaround" option in
>>>> the bios the machine hangs directly after:
>>>> [   36.780990] NET: Registered protocol family 16
>>>
>>> "MFGPT workaround"?  That sounds a bit frightening.
>>>
>>> Presumably, the BIOS is using the MFGPTs, but we're not detecting them as
>>> being in use.
>> Yes I think so too, for the fun of it I compiled a 2.6.16.29 kernel with
>> the attached patch from fi4l.
> 
> Okay - thats an MFPGT patch from pre-OLPC days. I am the guilty and
> dubious party.  We changed the API to work better with the timer tick,
> and thats the version that ended up in the kernel.
> 
> I really wish I could take back this patch, because it keeps coming back
> to torment me.  We must, as a people, put it behind us and forgot it. :)
> 
>> relevant output is this:
>> [   31.015425] geode-mfgpt:  7 timers available.
>> ...
>> [   31.245875] geode-mfgpt:  Registered timer 0
> 
>> So the above kernel detects only 7 timers not 8, and it works. But note
>> that timer 0 is not used as a clock event source but as a watchdog,
>> which btw actually works fine :-)
> 
> It detects 7 timers because of a bug in the code -  there really are 8 
> timers, which the current code correctly identifies.
Yes I can confirm this, changed MFGPT_MAX_TIMERS from 7 to 8 in the old
kernel and it still works.

>> The funny thing is the #define workaround part of this dubious patch and
>> its interaction with the bios:
>>
>> #ifdef WORKAROUND:
>>  I have to turn the "MFPGT workaround" option in the bios ON, to boot
>> the kernel probably.
>>
>> #ifndef WORKAROUND:
>>  I have to turn the "MFPGT workaround" option in the bios OFF, to boot
>> the kernel probably.
> 
> So the workaround works around the workaround.   Fun.  I think that Mitch
> Bradley verified that if you write the magic MSR when all the clocks are
> already clear that bad things happen.  The workaround probably adds a 
> dummy clock in.  Notice that the "magic MSR" no longer is in the vanilla
> code, and thats the way it should be.  If the BIOS doesn't allow use of
> the clocks, then we have to live with that.
> 
> So, based on everything you are saying, I think its clear that our
> problem isn't in the MFGPT, but rather in the timer tick (because, as
> you said, the watchdog works).  We try to use IRQ 7 for the tick, which
> Andres and I totally plucked out of thin air based on what we had to work
> with on OLPC.  Its totally possible that the TinyBIOS had other ideas.
> Please try to boot with nomfgpt, and see which interrupts are free, and
> use mfgpt_irq= to change it to something else if 7 is in use.  Based on
> your findings above, you'll probably need to leave the MFGPT workaround
> off from now on.
Great analysis! I think I can confirm this too. I tried the following:

First in mfgpt_timer_setup I commented out "clockevents_register_device"
result: the system still hangs with "registering the MFGT timer as a
clock event" !

Then I also commented out "ret = setup_irq(irq, &mfgptirq)".
result: system boots, voila!

However the vendor claims that 7 should be used (from the bios changelog):
"v0.90 (IRQ7 is no longer directed to the LPC bus, used as a default
interrupt for MFGPT high resolution timer."

There is also a interrupt map in the bios[0] readme:

IRQ0    timer
IRQ1    KBD (LPC)
IRQ2    cascade
IRQ3    COM1 serial (internal / LPC)
IRQ4    COM2 serial (LPC)
IRQ5    audio (CS5536)
IRQ6    FDC (LPC)
IRQ7    spare, used for MFGPT high resolution timer

IRQ8    RTC
IRQ9    PCI INTA
IRQ10   PCI INTB
IRQ11   PCI INTC
IRQ12   PCI INTD
IRQ13   floating point
IRQ14   IDE HDD
IRQ15   USB (CS5536)

/proc/interrupts on a running system looks like this:
           CPU0
  0:      12329          XT-PIC  timer
  2:          0          XT-PIC  cascade
  4:        240          XT-PIC  serial
  8:          3          XT-PIC  rtc
  9:        558          XT-PIC  wifi0
 10:      67591          XT-PIC  eth0
 11:        622          XT-PIC  wifi1
NMI:          0
ERR:          0

> I'll port the watchdog timer to the new API, and we can use that instead
> of the timer tick to just make sure that it isn't the timer that is broken.
> Also, hopefully that will cease the stream of angry emails asking me why
> the ancient patch doesn't work on a current kernel... :)
Watchdog for the new API would be great :-)

> Jordan
Thanks for your effort!

[0] http://www.pcengines.ch/file/alixb099.zip

  reply	other threads:[~2008-01-17 21:51 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 17:44 2.6.24-rc8 hangs at mfgpt-timer Arnd Hannemann
2008-01-16 21:19 ` Andres Salomon
2008-01-16 21:56   ` Andres Salomon
2008-01-17  9:54     ` Arnd Hannemann
2008-01-17 18:40       ` Andres Salomon
2008-01-17 19:53         ` Arnd Hannemann
2008-01-17 20:42           ` Andres Salomon
2008-01-17 21:19           ` Jordan Crouse
2008-01-17 21:50             ` Arnd Hannemann [this message]
2008-01-17 22:36               ` Jordan Crouse
2008-01-17 22:52                 ` Arnd Hannemann
2008-01-17 22:57                   ` Jordan Crouse
2008-01-17 23:39                     ` Arnd Hannemann
2008-01-18  0:40                       ` Jordan Crouse
2008-01-21 23:27                       ` Jordan Crouse
2008-01-21 23:32                         ` Willy Tarreau
2008-01-22 20:15                           ` Willy Tarreau
2008-01-22 21:08                             ` Jordan Crouse
2008-01-22 21:15                               ` Willy Tarreau
2008-01-23 16:36                                 ` Jordan Crouse
2008-01-23 16:10                                   ` Willy Tarreau
2008-01-22  9:03                         ` Arnd Hannemann
2008-01-22 10:11                           ` Lars Heete
2008-01-22 11:18                             ` Arnd Hannemann
2008-01-22 18:15                               ` Jordan Crouse
2008-01-22 19:27                               ` Jordan Crouse
2008-01-22 20:54                                 ` Arnd Hannemann
2008-01-22 21:10                                   ` Ingo Molnar
2008-01-22 21:20                                     ` Willy Tarreau
2008-01-22 21:53                                     ` [git pull] was: " Thomas Gleixner
2008-01-23 21:17                                     ` [PATCH 0/2] Was: " Willy Tarreau
2008-01-23 21:18                                       ` [PATCH 1/2] x86: GEODE fix MFGPT input clock value Willy Tarreau
2008-01-23 21:59                                         ` H. Peter Anvin
2008-01-23 22:11                                           ` Willy Tarreau
2008-01-23 22:22                                             ` H. Peter Anvin
2008-01-23 22:10                                               ` Willy Tarreau
2008-01-23 22:38                                             ` Jordan Crouse
2008-01-23 23:17                                               ` Arnd Hannemann
2008-01-23 21:19                                       ` [PATCH 2/2] x86: GEODE add the "mfgptfix" boot time option to fix MFGPT timers Willy Tarreau
2008-01-19  1:06                   ` [GEODE] Geode GX/LX watchdog timer (was 2.6.24-rc8 hangs at mfgpt-timer) Jordan Crouse
2008-01-19  6:36                     ` Willy Tarreau
2008-01-20 13:22                     ` Arnd Hannemann
2008-01-20 16:34                       ` Jordan Crouse
2008-01-21 17:07                       ` Geode GX/LX watchdog timer (RESEND) Jordan Crouse
2008-01-21 18:37                         ` Arnd Hannemann
2008-02-17 14:14                           ` Iain Paton
2008-02-17 14:46                             ` Arnd Hannemann
2008-02-17 14:54                               ` Adrian Bunk
2008-02-17 16:10                                 ` Iain Paton
2008-02-17 17:32                                   ` Andres Salomon
2008-02-17 19:46                                   ` Arnd Hannemann
2008-01-20 20:16                     ` [GEODE] Geode GX/LX watchdog timer (was 2.6.24-rc8 hangs at mfgpt-timer) Lennart Sorensen

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=478FCDB6.4010708@i4.informatik.rwth-aachen.de \
    --to=hannemann@i4.informatik.rwth-aachen.de \
    --cc=dilinger@queued.net \
    --cc=jordan.crouse@amd.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).