Re: [PATCH] init: Scream bloody murder if interrupts are enabled tooearly

From: Ard van Breemen
Date: Fri Mar 08 2013 - 04:12:33 EST


Hi,

On Thu, Mar 07, 2013 at 05:19:03PM -0500, Steven Rostedt wrote:
> diff --git a/init/main.c b/init/main.c
> index 63534a1..f0fe0a5 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -539,7 +539,7 @@ asmlinkage void __init start_kernel(void)
> * fragile until we cpu_idle() for the first time.
> */
> preempt_disable();
> - if (!irqs_disabled()) {
> + if (WARN_ON(!irqs_disabled())) {
> printk(KERN_WARNING "start_kernel(): bug: interrupts were "
> "enabled *very* early, fixing it\n");
> local_irq_disable();
>

The original code was a few versions before the WARN macros.
I think it's better to just change the printk to something like:
WARN(1,"interrupts were enabled *very* early, fixing it\n")

This will print the cause of the warning and then dump stack,
instead of having an unrelated message under the stackdump.

But: IANAM(acro)E(xpert), the real incantation might be
different.
But you are absolutely right that we should scream and shout.
This time in a way that's more in line with the others.

Regards,
Ard van Breemen.

--
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/