Skip to content

Commit

Permalink
[PATCH] CPU hotplug printk fix
Browse files Browse the repository at this point in the history
In the cpu hotplug case, per-cpu data possibly isn't initialized even the
system state is 'running'.  As the comments say in the original code, some
console drivers assume per-cpu resources have been allocated.  radeon fb is
one such driver, which uses kmalloc.  After a CPU is down, the per-cpu data
of slab is freed, so the system crashed when printing some info.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed Jun 25, 2005
1 parent 8d783b3 commit ac25575
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
log_level_unknown = 1;
}

if (!cpu_online(smp_processor_id()) &&
system_state != SYSTEM_RUNNING) {
if (!cpu_online(smp_processor_id())) {
/*
* Some console drivers may assume that per-cpu resources have
* been allocated. So don't allow them to be called by this
Expand Down

0 comments on commit ac25575

Please sign in to comment.