Merge branch 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull RAS fix from Thomas Gleixner:
"The MCE atomic notifier callchain invokes callbacks which might sleep.

Convert it to a blocking notifier and prevent calls from atomic
context"

* 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/mce: Make the MCE notifier a blocking one

+5 -16
+1 -1
arch/x86/kernel/cpu/mcheck/mce-genpool.c
··· 85 head = llist_reverse_order(head); 86 llist_for_each_entry_safe(node, tmp, head, llnode) { 87 mce = &node->mce; 88 - atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, mce); 89 gen_pool_free(mce_evt_pool, (unsigned long)node, sizeof(*node)); 90 } 91 }
··· 85 head = llist_reverse_order(head); 86 llist_for_each_entry_safe(node, tmp, head, llnode) { 87 mce = &node->mce; 88 + blocking_notifier_call_chain(&x86_mce_decoder_chain, 0, mce); 89 gen_pool_free(mce_evt_pool, (unsigned long)node, sizeof(*node)); 90 } 91 }
+1 -1
arch/x86/kernel/cpu/mcheck/mce-internal.h
··· 13 MCE_PANIC_SEVERITY, 14 }; 15 16 - extern struct atomic_notifier_head x86_mce_decoder_chain; 17 18 #define ATTR_LEN 16 19 #define INITIAL_CHECK_INTERVAL 5 * 60 /* 5 minutes */
··· 13 MCE_PANIC_SEVERITY, 14 }; 15 16 + extern struct blocking_notifier_head x86_mce_decoder_chain; 17 18 #define ATTR_LEN 16 19 #define INITIAL_CHECK_INTERVAL 5 * 60 /* 5 minutes */
+3 -14
arch/x86/kernel/cpu/mcheck/mce.c
··· 123 * CPU/chipset specific EDAC code can register a notifier call here to print 124 * MCE errors in a human-readable form. 125 */ 126 - ATOMIC_NOTIFIER_HEAD(x86_mce_decoder_chain); 127 128 /* Do initial initialization of a struct mce */ 129 void mce_setup(struct mce *m) ··· 220 221 WARN_ON(nb->priority > MCE_PRIO_LOWEST && nb->priority < MCE_PRIO_EDAC); 222 223 - atomic_notifier_chain_register(&x86_mce_decoder_chain, nb); 224 } 225 EXPORT_SYMBOL_GPL(mce_register_decode_chain); 226 ··· 228 { 229 atomic_dec(&num_notifiers); 230 231 - atomic_notifier_chain_unregister(&x86_mce_decoder_chain, nb); 232 } 233 EXPORT_SYMBOL_GPL(mce_unregister_decode_chain); 234 ··· 321 322 static void print_mce(struct mce *m) 323 { 324 - int ret = 0; 325 - 326 __print_mce(m); 327 - 328 - /* 329 - * Print out human-readable details about the MCE error, 330 - * (if the CPU has an implementation for that) 331 - */ 332 - ret = atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, m); 333 - if (ret == NOTIFY_STOP) 334 - return; 335 - 336 pr_emerg_ratelimited(HW_ERR "Run the above through 'mcelog --ascii'\n"); 337 } 338
··· 123 * CPU/chipset specific EDAC code can register a notifier call here to print 124 * MCE errors in a human-readable form. 125 */ 126 + BLOCKING_NOTIFIER_HEAD(x86_mce_decoder_chain); 127 128 /* Do initial initialization of a struct mce */ 129 void mce_setup(struct mce *m) ··· 220 221 WARN_ON(nb->priority > MCE_PRIO_LOWEST && nb->priority < MCE_PRIO_EDAC); 222 223 + blocking_notifier_chain_register(&x86_mce_decoder_chain, nb); 224 } 225 EXPORT_SYMBOL_GPL(mce_register_decode_chain); 226 ··· 228 { 229 atomic_dec(&num_notifiers); 230 231 + blocking_notifier_chain_unregister(&x86_mce_decoder_chain, nb); 232 } 233 EXPORT_SYMBOL_GPL(mce_unregister_decode_chain); 234 ··· 321 322 static void print_mce(struct mce *m) 323 { 324 __print_mce(m); 325 pr_emerg_ratelimited(HW_ERR "Run the above through 'mcelog --ascii'\n"); 326 } 327