aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2015-06-10 10:17:13 -0400
committerBorislav Petkov <bp@suse.de>2015-06-24 12:17:37 -0400
commit6d1e9bf5b04887a2220fbb44be074e9e8376e332 (patch)
treecbf5c74f528ed51f177f91d9f1a78f879d259a2e
parentf2f3dca1b7a66cbc91f45b59b8606bb325fa869f (diff)
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 <bp@suse.de>
-rw-r--r--drivers/edac/mce_amd_inj.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c
index bfb0f350cb0e..b92986b03f93 100644
--- a/drivers/edac/mce_amd_inj.c
+++ b/drivers/edac/mce_amd_inj.c
@@ -196,16 +196,16 @@ static void do_inject(void)
196 return; 196 return;
197 } 197 }
198 198
199 get_online_cpus();
200 if (!cpu_online(cpu))
201 goto err;
202
203 /* prep MCE global settings for the injection */ 199 /* prep MCE global settings for the injection */
204 mcg_status = MCG_STATUS_MCIP | MCG_STATUS_EIPV; 200 mcg_status = MCG_STATUS_MCIP | MCG_STATUS_EIPV;
205 201
206 if (!(i_mce.status & MCI_STATUS_PCC)) 202 if (!(i_mce.status & MCI_STATUS_PCC))
207 mcg_status |= MCG_STATUS_RIPV; 203 mcg_status |= MCG_STATUS_RIPV;
208 204
205 get_online_cpus();
206 if (!cpu_online(cpu))
207 goto err;
208
209 toggle_hw_mce_inject(cpu, true); 209 toggle_hw_mce_inject(cpu, true);
210 210
211 wrmsr_on_cpu(cpu, MSR_IA32_MCG_STATUS, 211 wrmsr_on_cpu(cpu, MSR_IA32_MCG_STATUS,