diff options
| -rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_intel.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c index 5f88abf07e9c..4f9a3cbfc4a3 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c | |||
| @@ -285,34 +285,39 @@ void cmci_clear(void) | |||
| 285 | raw_spin_unlock_irqrestore(&cmci_discover_lock, flags); | 285 | raw_spin_unlock_irqrestore(&cmci_discover_lock, flags); |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | static long cmci_rediscover_work_func(void *arg) | ||
| 289 | { | ||
| 290 | int banks; | ||
| 291 | |||
| 292 | /* Recheck banks in case CPUs don't all have the same */ | ||
| 293 | if (cmci_supported(&banks)) | ||
| 294 | cmci_discover(banks); | ||
| 295 | |||
| 296 | return 0; | ||
| 297 | } | ||
| 298 | |||
| 288 | /* | 299 | /* |
| 289 | * After a CPU went down cycle through all the others and rediscover | 300 | * After a CPU went down cycle through all the others and rediscover |
| 290 | * Must run in process context. | 301 | * Must run in process context. |
| 291 | */ | 302 | */ |
| 292 | void cmci_rediscover(int dying) | 303 | void cmci_rediscover(int dying) |
| 293 | { | 304 | { |
| 294 | int banks; | 305 | int cpu, banks; |
| 295 | int cpu; | ||
| 296 | cpumask_var_t old; | ||
| 297 | 306 | ||
| 298 | if (!cmci_supported(&banks)) | 307 | if (!cmci_supported(&banks)) |
| 299 | return; | 308 | return; |
| 300 | if (!alloc_cpumask_var(&old, GFP_KERNEL)) | ||
| 301 | return; | ||
| 302 | cpumask_copy(old, ¤t->cpus_allowed); | ||
| 303 | 309 | ||
| 304 | for_each_online_cpu(cpu) { | 310 | for_each_online_cpu(cpu) { |
| 305 | if (cpu == dying) | 311 | if (cpu == dying) |
| 306 | continue; | 312 | continue; |
| 307 | if (set_cpus_allowed_ptr(current, cpumask_of(cpu))) | 313 | |
| 314 | if (cpu == smp_processor_id()) { | ||
| 315 | cmci_rediscover_work_func(NULL); | ||
| 308 | continue; | 316 | continue; |
| 309 | /* Recheck banks in case CPUs don't all have the same */ | 317 | } |
| 310 | if (cmci_supported(&banks)) | ||
| 311 | cmci_discover(banks); | ||
| 312 | } | ||
| 313 | 318 | ||
| 314 | set_cpus_allowed_ptr(current, old); | 319 | work_on_cpu(cpu, cmci_rediscover_work_func, NULL); |
| 315 | free_cpumask_var(old); | 320 | } |
| 316 | } | 321 | } |
| 317 | 322 | ||
| 318 | /* | 323 | /* |
