diff options
author | Ingo Molnar <mingo@kernel.org> | 2012-11-13 19:01:01 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-11-13 19:01:01 +0100 |
commit | 226f69a4b7ed1da248d653aa1535bad61ba5fa49 (patch) | |
tree | f2c0833dd6500bd69fa447158cb615cb7f6f8678 | |
parent | 2bbf0a1427c377350f001fbc6260995334739ad7 (diff) | |
parent | 85b97637bb40a9f486459dd254598759af9c3d50 (diff) | |
download | op-kernel-dev-226f69a4b7ed1da248d653aa1535bad61ba5fa49.zip op-kernel-dev-226f69a4b7ed1da248d653aa1535bad61ba5fa49.tar.gz |
Merge tag 'please-pull-tangchen' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras into x86/urgent
Pull MCE fix from Tony Luck:
"Fix problem in CMCI rediscovery code that was illegally
migrating worker threads to other cpus."
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-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 5f88abf..4f9a3cb 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) raw_spin_unlock_irqrestore(&cmci_discover_lock, flags); } +static long cmci_rediscover_work_func(void *arg) +{ + int banks; + + /* Recheck banks in case CPUs don't all have the same */ + if (cmci_supported(&banks)) + cmci_discover(banks); + + return 0; +} + /* * After a CPU went down cycle through all the others and rediscover * Must run in process context. */ void cmci_rediscover(int dying) { - int banks; - int cpu; - cpumask_var_t old; + int cpu, banks; if (!cmci_supported(&banks)) return; - if (!alloc_cpumask_var(&old, GFP_KERNEL)) - return; - cpumask_copy(old, ¤t->cpus_allowed); for_each_online_cpu(cpu) { if (cpu == dying) continue; - if (set_cpus_allowed_ptr(current, cpumask_of(cpu))) + + if (cpu == smp_processor_id()) { + cmci_rediscover_work_func(NULL); continue; - /* Recheck banks in case CPUs don't all have the same */ - if (cmci_supported(&banks)) - cmci_discover(banks); - } + } - set_cpus_allowed_ptr(current, old); - free_cpumask_var(old); + work_on_cpu(cpu, cmci_rediscover_work_func, NULL); + } } /* |