From: Borislav Petkov Date: Wed, 10 Jun 2015 14:17:13 +0000 (+0200) Subject: EDAC, mce_amd_inj: Move bit preparations before the injection X-Git-Tag: v4.9.8~3965^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d1e9bf5b04887a2220fbb44be074e9e8376e332;p=platform%2Fkernel%2Flinux-rpi3.git EDAC, mce_amd_inj: Move bit preparations before the injection We do get_online_cpus() and then start noodling with the bits. Do that *before* we grab the hotplug lock. Signed-off-by: Borislav Petkov --- diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c index bfb0f35..b92986b 100644 --- a/drivers/edac/mce_amd_inj.c +++ b/drivers/edac/mce_amd_inj.c @@ -196,16 +196,16 @@ static void do_inject(void) return; } - get_online_cpus(); - if (!cpu_online(cpu)) - goto err; - /* prep MCE global settings for the injection */ mcg_status = MCG_STATUS_MCIP | MCG_STATUS_EIPV; if (!(i_mce.status & MCI_STATUS_PCC)) mcg_status |= MCG_STATUS_RIPV; + get_online_cpus(); + if (!cpu_online(cpu)) + goto err; + toggle_hw_mce_inject(cpu, true); wrmsr_on_cpu(cpu, MSR_IA32_MCG_STATUS,