lkml.org 
[lkml]   [2013]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] init: Scream bloody murder if interrupts are enabled too early
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.



\
 
 \ /
  Last update: 2013-03-08 10:44    [W:0.057 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site