Re: sc3200 cpu + apm module kernel crash

From: Nicolas FR
Date: Sun Nov 05 2006 - 16:34:20 EST


I have finally traced down the bug (Tatung webpad TWN-5213CU with SC3200 CPU):

- in apm_mainloop there is an for(;;) loop, which set a
scheduler_timeout (1second) and then calls apm_event_handler().

- apm_event_handler does some checks and calls check_events();

- check_events has a loop:
while ((event = get_event()) != 0) { switch (event) {...} }

The module was "crashing" on my box because it keeps on receiving
events=APM_UPDATE_TIME meaning that it would never get out of the
while() loop in check_events. I need to do some tests but I might
simply fix this by ignoring APM_UPDATE_TIME events. I first thought
replacing the "while ((event = get_event()) != 0)" by an "if ((event =
get_event()) != 0)" but maybe I would miss other events doing this?


Best regards,
Nicolas.

PS: btw, thanks for your email that's really nice to answer every
message on this mailing list.

On 11/5/06, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
Ar Sad, 2006-11-04 am 00:06 +0100, ysgrifennodd Nicolas FR:
> I have thrown a bunch of "printk(KERN_INFO "apm: I am here\n");" and
> noticed the crash is happening just when calling apm_event_handler();
> and does not even execute any instruction in this function... This is
> the point I don't understand, how can it crash just on calling a
> function and not executing the first statement in this function?

APM is BIOS code so the assembler inlines trap into the firmware and the
firmware sometimes isn't very good, particularly the 32bit entry points
which are not used by a certain other vendors products.

In those cases you need to trace the asm code in the firmware and see if
the firmware is buggy.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/