Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204736
b: refs/heads/master
c: e8e5c21
h: refs/heads/master
v: v3
  • Loading branch information
Matt Evans authored and Benjamin Herrenschmidt committed Jul 31, 2010
1 parent c9eb7e7 commit 4e949a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2f7f73717c0a2927bbe7551d90b1ec47a094361
refs/heads/master: e8e5c2155b0035b6e04f29be67f6444bc914005b
26 changes: 25 additions & 1 deletion trunk/arch/powerpc/kernel/machine_kexec_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/init_task.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/cpu.h>

#include <asm/page.h>
#include <asm/current.h>
Expand Down Expand Up @@ -216,9 +217,32 @@ static void kexec_prepare_cpus_wait(int wait_state)
mb();
}

static void kexec_prepare_cpus(void)
/*
* We need to make sure each present CPU is online. The next kernel will scan
* the device tree and assume primary threads are online and query secondary
* threads via RTAS to online them if required. If we don't online primary
* threads, they will be stuck. However, we also online secondary threads as we
* may be using 'cede offline'. In this case RTAS doesn't see the secondary
* threads as offline -- and again, these CPUs will be stuck.
*
* So, we online all CPUs that should be running, including secondary threads.
*/
static void wake_offline_cpus(void)
{
int cpu = 0;

for_each_present_cpu(cpu) {
if (!cpu_online(cpu)) {
printk(KERN_INFO "kexec: Waking offline cpu %d.\n",
cpu);
cpu_up(cpu);
}
}
}

static void kexec_prepare_cpus(void)
{
wake_offline_cpus();
smp_call_function(kexec_smp_down, NULL, /* wait */0);
local_irq_disable();
mb(); /* make sure IRQs are disabled before we say they are */
Expand Down

0 comments on commit 4e949a9

Please sign in to comment.