Skip to content

Commit 6d1e9bf

Browse files
committed
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>
1 parent f2f3dca commit 6d1e9bf

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/edac/mce_amd_inj.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,16 @@ static void do_inject(void)
196196
return;
197197
}
198198

199-
get_online_cpus();
200-
if (!cpu_online(cpu))
201-
goto err;
202-
203199
/* prep MCE global settings for the injection */
204200
mcg_status = MCG_STATUS_MCIP | MCG_STATUS_EIPV;
205201

206202
if (!(i_mce.status & MCI_STATUS_PCC))
207203
mcg_status |= MCG_STATUS_RIPV;
208204

205+
get_online_cpus();
206+
if (!cpu_online(cpu))
207+
goto err;
208+
209209
toggle_hw_mce_inject(cpu, true);
210210

211211
wrmsr_on_cpu(cpu, MSR_IA32_MCG_STATUS,

0 commit comments

Comments
 (0)