Skip to contentSkip to conversation

mach-shmobile: r8a7779 SMP TWD boot regression fix

PATCH Applied Magnus Damm 3 participants 6 messages May 10, 2012

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/1 mach-shmobile: r8a7779 SMP TWD boot regression fix

From: Magnus Damm <[email protected]>

Fix SMP TWD boot regression on r8a7779 based platforms caused by:

4200b16 ARM: shmobile: convert to twd_local_timer_register() interface

After the merge of the above commit it has been impossible to boot r8a7779 based SoCs with SMP enabled and CONFIG_HAVE_ARM_TWD=y. The kernel crashes at smp_init_cpus() timing which is before the console has been initialized, so to the user this looks like a kernel lock up without any particular error message.

This patch fixes the regression on r8a7779 by moving the TWD registration code from smp_init_cpus() to sys_timer->init() time.

---

Fixes 3.4-rc regression.

Tested on the r8a7779 Marzen board on top of post v3.4-rc6:
7ee94d97aafacf5a019b3578e0eae6daa2e2bcd5

 arch/arm/mach-shmobile/include/mach/common.h |    1 +
 arch/arm/mach-shmobile/setup-r8a7779.c       |    4 ++++
 arch/arm/mach-shmobile/smp-r8a7779.c         |    8 +++++++-
 3 files changed, 12 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -82,5 +82,6 @@ extern int r8a7779_platform_cpu_kill(uns
 extern void r8a7779_secondary_init(unsigned int cpu);
 extern int r8a7779_boot_secondary(unsigned int cpu);
 extern void r8a7779_smp_prepare_cpus(void);
+extern void r8a7779_register_twd(void);
 
 #endif /* __ARCH_MACH_COMMON_H */
arch/arm/mach-shmobile/setup-r8a7779.c +4 -0
@@ -262,10 +262,14 @@ void __init r8a7779_add_standard_devices
 			    ARRAY_SIZE(r8a7779_late_devices));
 }
 
+/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
+void __init __weak r8a7779_register_twd(void) { }
+
 static void __init r8a7779_earlytimer_init(void)
 {
 	r8a7779_clock_init();
 	shmobile_earlytimer_init();
+	r8a7779_register_twd();
 }
 
 void __init r8a7779_add_early_devices(void)
arch/arm/mach-shmobile/smp-r8a7779.c +7 -1
@@ -64,8 +64,15 @@ static void __iomem *scu_base_addr(void)
 static DEFINE_SPINLOCK(scu_lock);
 static unsigned long tmp;
 
+#ifdef CONFIG_HAVE_ARM_TWD
 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);
 
+void __init r8a7779_register_twd(void)
+{
+	twd_local_timer_register(&twd_local_timer);
+}
+#endif
+
 static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
 {
 	void __iomem *scu_base = scu_base_addr();
@@ -84,7 +91,6 @@ unsigned int __init r8a7779_get_core_cou
 {
 	void __iomem *scu_base = scu_base_addr();
 
-	shmobile_twd_init(&twd_local_timer);
 	return scu_get_core_count(scu_base);
 }
 
#1 lore raw

Hi Magnus,

Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Fix SMP TWD boot regression on r8a7779 based platforms caused by:

4200b16 ARM: shmobile: convert to twd_local_timer_register() interface

After the merge of the above commit it has been impossible to boot r8a7779 based SoCs with SMP enabled and CONFIG_HAVE_ARM_TWD=y. The kernel crashes at smp_init_cpus() timing which is before the console has been initialized, so to the user this looks like a kernel lock up without any particular error message.

Quoted 4 lines

This patch fixes the regression on r8a7779 by moving the TWD registration code from smp_init_cpus() to sys_timer->init() time.

I'm a bit confused here. Does sh73a0 work OK? If so, why is the behavior any different?

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
author maintainer
#2 lore raw
In reply to Magnus Damm
Quoted 15 lines · Marc Zyngier

Hi Magnus,

Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Fix SMP TWD boot regression on r8a7779 based platforms caused by:

4200b16 ARM: shmobile: convert to twd_local_timer_register() interface

After the merge of the above commit it has been impossible to boot r8a7779 based SoCs with SMP enabled and CONFIG_HAVE_ARM_TWD=y. The kernel crashes at smp_init_cpus() timing which is before the console has been initialized, so to the user this looks like a kernel lock up without any particular error message.

Quoted 7 lines
Quoted 4 lines

This patch fixes the regression on r8a7779 by moving the TWD registration code from smp_init_cpus() to sys_timer->init() time.

I'm a bit confused here. Does sh73a0 work OK? If so, why is the behavior any different?

It doesn't,both are busted I'm afraid. But I fixed the r8a7779 one myself and let Morimoto-san deal with sh73a0 to make sure it got fixed and tested too.

Cheers,

/ magnus

#3 lore raw
In reply to Magnus Damm
Quoted 19 lines · Magnus Damm
Quoted 18 lines · Marc Zyngier

Hi Magnus,

Quoted 15 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Fix SMP TWD boot regression on r8a7779 based platforms caused by:

4200b16 ARM: shmobile: convert to twd_local_timer_register() interface

After the merge of the above commit it has been impossible to boot r8a7779 based SoCs with SMP enabled and CONFIG_HAVE_ARM_TWD=y. The kernel crashes at smp_init_cpus() timing which is before the console has been initialized, so to the user this looks like a kernel lock up without any particular error message.

This patch fixes the regression on r8a7779 by moving the TWD registration code from smp_init_cpus() to sys_timer->init() time.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I'm a bit confused here. Does sh73a0 work OK? If so, why is the behavior any different?

It doesn't,both are busted I'm afraid. But I fixed the r8a7779 one myself and let Morimoto-san deal with sh73a0 to make sure it got fixed and tested too.

OK. It would be good to fold these two patches into one, then.

FWIW, Acked-by: Marc Zyngier <[email protected]>

Thanks,

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
author maintainer
#4 lore raw
In reply to Magnus Damm
Quoted 25 lines · Marc Zyngier
Quoted 24 lines · Magnus Damm
Quoted 22 lines · Marc Zyngier

Hi Magnus,

Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Fix SMP TWD boot regression on r8a7779 based platforms caused by:

4200b16 ARM: shmobile: convert to twd_local_timer_register() interface

After the merge of the above commit it has been impossible to boot r8a7779 based SoCs with SMP enabled and CONFIG_HAVE_ARM_TWD=y. The kernel crashes at smp_init_cpus() timing which is before the console has been initialized, so to the user this looks like a kernel lock up without any particular error message.

Quoted 4 lines

This patch fixes the regression on r8a7779 by moving the TWD registration code from smp_init_cpus() to sys_timer->init() time.

I'm a bit confused here. Does sh73a0 work OK? If so, why is the behavior any different?

Quoted 7 lines
Quoted 3 lines

It doesn't,both are busted I'm afraid. But I fixed the r8a7779 one myself and let Morimoto-san deal with sh73a0 to make sure it got fixed and tested too.

OK. It would be good to fold these two patches into one, then.

FWIW, Acked-by: Marc Zyngier <[email protected]>

Thanks! I intentionally made them broken out since they fixed different platforms, but that's not so important to me.

/ magnus

#5 lore raw
In reply to Magnus Damm
Quoted 30 lines · Magnus Damm
Quoted 29 lines · Marc Zyngier
Quoted 27 lines · Magnus Damm
Quoted 15 lines · Marc Zyngier

Hi Magnus,

Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Fix SMP TWD boot regression on r8a7779 based platforms caused by:

4200b16 ARM: shmobile: convert to twd_local_timer_register() interface

After the merge of the above commit it has been impossible to boot r8a7779 based SoCs with SMP enabled and CONFIG_HAVE_ARM_TWD=y. The kernel crashes at smp_init_cpus() timing which is before the console has been initialized, so to the user this looks like a kernel lock up without any particular error message.

Quoted 7 lines
Quoted 4 lines

This patch fixes the regression on r8a7779 by moving the TWD registration code from smp_init_cpus() to sys_timer->init() time.

I'm a bit confused here. Does sh73a0 work OK? If so, why is the behavior any different?

It doesn't,both are busted I'm afraid. But I fixed the r8a7779 one myself and let Morimoto-san deal with sh73a0 to make sure it got fixed and tested too.

Quoted 6 lines
Quoted 3 lines

OK. It would be good to fold these two patches into one, then.

FWIW, Acked-by: Marc Zyngier <[email protected]>

Thanks! I intentionally made them broken out since they fixed different platforms, but that's not so important to me.

Applied.

Thanks,
Rafael