[Top] [All Lists]

[PATCH] MIPS: Makefile: workaround printk recursion bug

Subject: [PATCH] MIPS: Makefile: workaround printk recursion bug
From: Wladislav Wiebe <>
Date: Wed, 10 Apr 2013 11:12:21 +0200
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:content-type:content-transfer-encoding; bh=bLOyTgV8oJppMuSBzQX0xflaDVPILd3FrcFD2/2e2mQ=; b=e7nlw8e3uJ9nFKolTXN0+pCPjrl0i7ZHHsKQTzNIQZpSh9+uHUEerLqQIXODV18yt1 iP0uK2DjrrDr+jRDns6YXT8zw+RD2aQw5QoiLcX6wJWY6adZTx21nF4i0//9xiGmkj39 Hv9k1zN8zn8MWv53/A8+hvfkXpnYe4h8pZLB3nRT2TSstH+iDQHHn1nGiaZkURcIX1/a Q3aYB6nnhAEJYR2coaSeH71o71gUkGe98AMuEiBX8F04/SwD4mxtlYMTYU2gZc4lSLVG NFoIpyYl/+cmBj9LMevey2SNWejxCyiUWrKp0HOGeNJIjuMGcoo0OXX1xU3ptXNwLWT0 uMpQ==
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130308 Thunderbird/17.0.4
From: Wladislav Wiebe <>

Function tracing is broken due to removal of selecting FRAME_POINTER with
FUNCTION_TRACER as result of commit: b732d439cb43336cd6d7e804ecb2c81193ef63b0

Latest commit ad8c396936e328f5344e1881afde9e28d5f2045f "MIPS: Unbreak
function tracer for 64-bit kernel." fixes just the early startup hang,
but on MIPS64/CAVIUM_OCTEON2 are still random printk recursion bugs
which cause also Kernel hangs, especially on late startup phase when
network drivers get loaded. This patch enable for CAVIUM_OCTEON2/64 Bit
architecture -fno-omit-frame-pointer cflag when FUNCTION_TRACER get
enabled. This will fix random Kernel hangs with "BUG: recent printk
recursion!" from linux/kernel/printk.c.

Maybe there exist a other solution in mcount handling, since in the
commit message from Al Cooper is mentioned that "MIPS frame pointers are
generally considered to be useless because they cannot be used to unwind
the stack. Unfortunately the MIPS function tracing code has bugs that
are masked by the use of frame pointers. This commit fixes the bugs so
that MIPS frame pointers don't need to be enabled."

But this is just a solution for MIPS32 - on a symmetric multiprocessing
@MIPS64/CAVIUM_OCTEON2 it doesn't work properly.

Signed-off-by: Wladislav Wiebe <>
 arch/mips/Makefile |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 6f7978f..8befe31 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -119,6 +119,15 @@ cflags-$(CONFIG_SB1XXX_CORELIS)    += $(call 
cc-option,-mno-sched-prolog) \

+# FTrace depended compiler options, currently only needed by MIPS64/OCTEON2.
+ifdef CONFIG_64BIT
+cflags-$(CONFIG_FUNCTION_TRACER) += $(call cc-option,-fno-omit-frame-pointer)
 # CPU-dependent compiler/assembler options for optimization.
 cflags-$(CONFIG_CPU_R3000)     += -march=r3000

<Prev in Thread] Current Thread [Next in Thread>