From: Anton Blanchard Date: Wed, 28 Sep 2005 04:45:38 +0000 (-0700) Subject: [PATCH] ppc64: Add missing barrier() in kexec code X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b3ca80935100af47f226be439cb266378dab7bf7;p=linux-beck.git [PATCH] ppc64: Add missing barrier() in kexec code Mikey and I were testing kexec and hit a lockup. It turns out gcc 4.0 optimises the kexec_prepare_cpus loop so we avoid reloading paca.hw_cpu_id. A gcc barrier() fixes the problem. Signed-off-by: Anton Blanchard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/ppc64/kernel/machine_kexec.c b/arch/ppc64/kernel/machine_kexec.c index 4775f12a013c..bf7cc4f8210f 100644 --- a/arch/ppc64/kernel/machine_kexec.c +++ b/arch/ppc64/kernel/machine_kexec.c @@ -205,6 +205,7 @@ static void kexec_prepare_cpus(void) continue; while (paca[i].hw_cpu_id != -1) { + barrier(); if (!cpu_possible(i)) { printk("kexec: cpu %d hw_cpu_id %d is not" " possible, ignoring\n",