diff mbox

ARM: smp_twd: make twd_local_timer_of_register() no-op for nosmp

Message ID 1361450661-10324-1-git-send-email-shawn.guo@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Shawn Guo Feb. 21, 2013, 12:44 p.m. UTC
When booting a SMP build kernel with nosmp on kernel cmdline, the
following fat warning will be hit.

------------[ cut here ]------------
WARNING: at arch/arm/kernel/smp_twd.c:345
twd_local_timer_of_register failed (-6)
Modules linked in:
[<80011f14>] (dump_backtrace+0x0/0x10c) from [<8044dd30>]
 r7:805e9f58 r6:805ba84c r5:80539331 r4:00000159
[<8044dd18>] (dump_stack+0x0/0x1c) from [<80020fbc>]
[<80020f68>] (warn_slowpath_common+0x0/0x6c) from [<80021078>]
 r9:412fc09a r8:8fffffff r7:ffffffff r6:00000001 r5:80633b8c
[<80021040>] (warn_slowpath_fmt+0x0/0x40) from [<805ba84c>]
 r3:fffffffa r2:8053934b
[<805ba7d0>] (twd_local_timer_of_register+0x0/0x90) from [<805c0bec>]
 r5:80633800 r4:8053b701
[<805c0bd4>] (imx6q_timer_init+0x0/0x4c) from [<805ba4e8>]
 r5:80633800 r4:805dc0f4
[<805ba4c0>] (time_init+0x0/0x38) from [<805b6854>]
[<805b66b4>] (start_kernel+0x0/0x310) from [<10008044>] (0x10008044)
 r8:1000406a r7:805f3f8c r6:805dc0c4 r5:805f0518 r4:10c5387d
---[ end trace 1b75b31a2719ed1c ]---

Check (!is_smp() || !setup_max_cpus) in twd_local_timer_of_register()
to make it be a no-op for the conditions, thus avoid above warning.

Reported-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
 arch/arm/kernel/smp_twd.c |    4 ++++
 1 file changed, 4 insertions(+)
diff mbox


diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index c092115..3f25650 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -22,6 +22,7 @@ 
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
+#include <asm/smp_plat.h>
 #include <asm/smp_twd.h>
 #include <asm/localtimer.h>
@@ -373,6 +374,9 @@  void __init twd_local_timer_of_register(void)
 	struct device_node *np;
 	int err;
+	if (!is_smp() || !setup_max_cpus)
+		return;
 	np = of_find_matching_node(NULL, twd_of_match);
 	if (!np)