Re: [PATCH] solved APM bug with -rc5

Richard Gooch (rgooch@ras.ucalgary.ca)
Thu, 1 Aug 2002 14:52:16 -0600


Willy TARREAU writes:
> I finally got rid of it ! I now understand why it hanged randomly, and
> why I spent lots of time adding/removing unrelated patches. It's because
> in apm=power-off mode (SMP), a kernel thread is started for the apm()
> function, which does bios calls. And sometimes, the bios is called from
> CPU >0, which my bios doesn't like at all, thus explaining why the oopses
> were corrupted.
[...]
> diff -urN linux-2.4.19-rc5/arch/i386/kernel/apm.c linux-2.4.19-rc5-fix/arch/i386/kernel/apm.c
> --- linux-2.4.19-rc5/arch/i386/kernel/apm.c Thu Aug 1 22:07:39 2002
> +++ linux-2.4.19-rc5-fix/arch/i386/kernel/apm.c Thu Aug 1 22:26:56 2002
> @@ -1661,6 +1661,17 @@
> strcpy(current->comm, "kapmd");
> sigfillset(&current->blocked);
>
> +#ifdef CONFIG_SMP
> + /* 2002/08/01 - WT
> + * This is to avoid random crashes at boot time during initialization
> + * on SMP systems in case of "apm=power-off" mode. Seen on ASUS A7M266D.
> + * Some bioses don't like being called from CPU != 0.
> + */
> + while (cpu_number_map(smp_processor_id()) != 0) {
> + schedule();
> + }
> +#endif
> +

Hm. I bet you didn't try this with CONFIG_PREEMPT=y, right? IIRC, the
wonderful world of preemption means that you can get rescheduled on
another CPU without warning, unless you take a lock or explicitely
disable preemption.

Regards,

Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/