linux-mips
[Top] [All Lists]

[PATCH] MIPS: Makefile: workaround printk recursion bug

To: ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: [PATCH] MIPS: Makefile: workaround printk recursion bug
From: Wladislav Wiebe <wladislav.kw@gmail.com>
Date: Wed, 10 Apr 2013 11:12:21 +0200
Cc: linux-kernel@vger.kernel.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; 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: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130308 Thunderbird/17.0.4
From: Wladislav Wiebe <wladislav.kw@gmail.com>

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 <wladislav.kw@gmail.com>
---
 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) \
                                   -fno-omit-frame-pointer

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


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