From: Kei Tokunaga <ktokunag@redhat.com> Date: Thu, 20 Nov 2008 09:44:21 -0500 Subject: [ia64] replace printk with mprintk in MCA/INIT context Message-id: 492577C5.7080305@redhat.com O-Subject: [RHEL5.3][PATCH] replace printk with mprintk in ia64_mca_modify_original_stack Bugzilla: 471970 RH-Acked-by: Prarit Bhargava <prarit@redhat.com> RH-Acked-by: Dave Anderson <anderson@redhat.com> bz471970 https://bugzilla.redhat.com/show_bug.cgi?id=471970 Description =========== Using printk from MCA/INIT context is unsafe since it can cause deadlock. The ia64_mca_modify_original_stack is called from both a MCA handler and an INIT handler, so it should use mprintk instead of printk. This problem would block execution of kdump from INIT button. If INIT is asserted while one of cpus is processing printk, and if a printk is called from the INIT handler, then system will hang up and 2nd kernel will never start up. kABI status =========== No kABI breakage found. Brew status =========== Built on all platforms. https://brewweb.devel.redhat.com/taskinfo?taskID=1580701 Upstream status =============== commit 150e323dcb4f1d8906c480162ae4b24a83453d44 Author: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Date: Mon, 17 Nov 2008 09:46:08 +0900 Test status =========== It's really hard to reproduce the bug as we've never experienced it in real life. Fujitsu found the bug from the source code review and it's obvious bug and the fix is a one-liner. For this posting, I confirmed it built, booted OK, and kdump worked on PRIMEQUEST located in Westford. Additional notes ================ - The patch applies to 2.6.18-124.el5. - This only effects ia64. Please review and ACK, Kei -- Kei Tokunaga Fujitsu on-site partner diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 39ed501..272f3f3 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c @@ -1115,7 +1115,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs, return previous_current; no_mod: - printk(KERN_INFO "cpu %d, %s %s, original stack not modified\n", + mprintk(KERN_INFO "cpu %d, %s %s, original stack not modified\n", smp_processor_id(), type, msg); return previous_current; }