Commit 4be16e54 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] log_buf_len_setup() irq fix

log_buf_len_setup() is called on the start_kernel->parse_args() path.  It
must not enable interrupts.
parent e6b1fdb7
...@@ -181,6 +181,7 @@ int __init add_preferred_console(char *name, int idx, char *options) ...@@ -181,6 +181,7 @@ int __init add_preferred_console(char *name, int idx, char *options)
static int __init log_buf_len_setup(char *str) static int __init log_buf_len_setup(char *str)
{ {
unsigned long size = memparse(str, &str); unsigned long size = memparse(str, &str);
unsigned long flags;
if (size > log_buf_len) { if (size > log_buf_len) {
unsigned long start, dest_idx, offset; unsigned long start, dest_idx, offset;
...@@ -192,7 +193,7 @@ static int __init log_buf_len_setup(char *str) ...@@ -192,7 +193,7 @@ static int __init log_buf_len_setup(char *str)
goto out; goto out;
} }
spin_lock_irq(&logbuf_lock); spin_lock_irqsave(&logbuf_lock, flags);
log_buf_len = size; log_buf_len = size;
log_buf = new_log_buf; log_buf = new_log_buf;
...@@ -206,7 +207,7 @@ static int __init log_buf_len_setup(char *str) ...@@ -206,7 +207,7 @@ static int __init log_buf_len_setup(char *str)
log_start -= offset; log_start -= offset;
con_start -= offset; con_start -= offset;
log_end -= offset; log_end -= offset;
spin_unlock_irq(&logbuf_lock); spin_unlock_irqrestore(&logbuf_lock, flags);
printk("log_buf_len: %d\n", log_buf_len); printk("log_buf_len: %d\n", log_buf_len);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment