Skip to contentSkip to conversation

ARM: shmobile: r8a7779 Marzen legacy fix V2

PATCH In review Magnus Damm 3 participants 12 messages Jul 14, 2015 – Jul 24, 2015

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH v2 1/1 ARM: shmobile: r8a7779 Marzen legacy fix V2

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

---

Developed and tested on top of renesas-devel-20150706-v4.2-rc1

 arch/arm/Kconfig                       |    1 -
 arch/arm/mach-shmobile/setup-r8a7779.c |    2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/Kconfig +0 -1
@@ -626,7 +626,6 @@ config ARCH_SHMOBILE_LEGACY
 	select CPU_V7
 	select GENERIC_CLOCKEVENTS
 	select HAVE_ARM_SCU if SMP
-	select HAVE_ARM_TWD if SMP
 	select HAVE_SMP
 	select MIGHT_HAVE_CACHE_L2X0
 	select MULTI_IRQ_HANDLER
arch/arm/mach-shmobile/setup-r8a7779.c +2 -0
@@ -677,6 +677,8 @@ void __init r8a7779_add_standard_devices
 
 void __init r8a7779_add_early_devices(void)
 {
+	shmobile_init_delay();
+
 	early_platform_add_devices(r8a7779_early_devices,
 				   ARRAY_SIZE(r8a7779_early_devices));
 
Tested-by on v2 1/1
#1 lore raw
Quoted 8 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Quoted 8 lines

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

Thanks, that does seem to improve things a lot.
I can now boot all the way to a nfs userspace :^)

I wonder if we should also add the following?

Fixes f2a5473861cf ("clocksource: sh_tmu: Set cpu_possible_mask to fix SMP broadcast")

For the record, I found that after I enabled CONFIG_SMSC_PHY the boot now gets as far as initialising SDHI.

Quoted 30 lines

---

Developed and tested on top of renesas-devel-20150706-v4.2-rc1

 arch/arm/Kconfig                       |    1 -
 arch/arm/mach-shmobile/setup-r8a7779.c |    2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/Kconfig +0 -1
@@ -626,7 +626,6 @@ config ARCH_SHMOBILE_LEGACY
 	select CPU_V7
 	select GENERIC_CLOCKEVENTS
 	select HAVE_ARM_SCU if SMP
-	select HAVE_ARM_TWD if SMP
 	select HAVE_SMP
 	select MIGHT_HAVE_CACHE_L2X0
 	select MULTI_IRQ_HANDLER
arch/arm/mach-shmobile/setup-r8a7779.c +2 -0
@@ -677,6 +677,8 @@ void __init r8a7779_add_standard_devices
 
 void __init r8a7779_add_early_devices(void)
 {
+	shmobile_init_delay();
+
 	early_platform_add_devices(r8a7779_early_devices,
 				   ARRAY_SIZE(r8a7779_early_devices));
 
author maintainer
#2 lore raw
In reply to Magnus Damm

Hi Simon,

Quoted 13 lines · Simon Horman
Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Quoted 8 lines
Quoted 4 lines

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

Thanks, that does seem to improve things a lot.
I can now boot all the way to a nfs userspace :^)

Yay!

Quoted 1 line

Thanks for testing!

Quoted 7 lines

I wonder if we should also add the following?

Fixes f2a5473861cf ("clocksource: sh_tmu: Set cpu_possible_mask to fix SMP broadcast")

For the record, I found that after I enabled CONFIG_SMSC_PHY the boot now gets as far as initialising SDHI.

Feel free to include any comment you think will help. My view is that the TMU commit pointed out by itself is not really troublesome, it is more that on legacy systems using earlytimer and TWD that this problem happens. For multiplatform the commit is fine.

Cheers,

/ magnus

#3 lore raw
In reply to Magnus Damm
Quoted 36 lines · Magnus Damm

Hi Simon,

Quoted 13 lines · Simon Horman
Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Quoted 8 lines
Quoted 4 lines

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

Thanks, that does seem to improve things a lot.
I can now boot all the way to a nfs userspace :^)

Yay!

Quoted 1 line

Thanks for testing!

Quoted 5 lines

I wonder if we should also add the following?

Fixes f2a5473861cf ("clocksource: sh_tmu: Set cpu_possible_mask to fix SMP broadcast")
Quoted 7 lines
Quoted 2 lines

For the record, I found that after I enabled CONFIG_SMSC_PHY the boot now gets as far as initialising SDHI.

Feel free to include any comment you think will help. My view is that the TMU commit pointed out by itself is not really troublesome, it is more that on legacy systems using earlytimer and TWD that this problem happens. For multiplatform the commit is fine.

From my point of view the patch mentioned caused a behavioural change on legacy systems which this patch addresses.

author maintainer
#4 lore raw
In reply to Magnus Damm
Quoted 40 lines · Simon Horman
Quoted 39 lines · Magnus Damm

Hi Simon,

Quoted 13 lines · Simon Horman
Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Quoted 8 lines
Quoted 4 lines

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

Thanks, that does seem to improve things a lot.
I can now boot all the way to a nfs userspace :^)

Yay!

Quoted 1 line

Thanks for testing!

Quoted 7 lines

I wonder if we should also add the following?

Fixes f2a5473861cf ("clocksource: sh_tmu: Set cpu_possible_mask to fix SMP broadcast")

For the record, I found that after I enabled CONFIG_SMSC_PHY the boot now gets as far as initialising SDHI.

Quoted 7 lines
Quoted 4 lines

Feel free to include any comment you think will help. My view is that the TMU commit pointed out by itself is not really troublesome, it is more that on legacy systems using earlytimer and TWD that this problem happens. For multiplatform the commit is fine.

From my point of view the patch mentioned caused a behavioural change on legacy systems which this patch addresses.

Sure, I agree about that. =)

/ magnus

#5 lore raw
In reply to Magnus Damm
Quoted 46 lines · Magnus Damm
Quoted 45 lines · Simon Horman
Quoted 43 lines · Magnus Damm

Hi Simon,

Quoted 13 lines · Simon Horman
Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Quoted 8 lines
Quoted 4 lines

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

Thanks, that does seem to improve things a lot.
I can now boot all the way to a nfs userspace :^)

Yay!

Quoted 1 line

Thanks for testing!

Quoted 7 lines

I wonder if we should also add the following?

Fixes f2a5473861cf ("clocksource: sh_tmu: Set cpu_possible_mask to fix SMP broadcast")

For the record, I found that after I enabled CONFIG_SMSC_PHY the boot now gets as far as initialising SDHI.

Feel free to include any comment you think will help. My view is that the TMU commit pointed out by itself is not really troublesome, it is more that on legacy systems using earlytimer and TWD that this problem happens. For multiplatform the commit is fine.

Quoted 4 lines
Quoted 2 lines

From my point of view the patch mentioned caused a behavioural change on legacy systems which this patch addresses.

Sure, I agree about that. =)

Excellent.

With the above in mind I will queue this up with the Fixes tag as a fix for v4.3. It may well filter into -stable from there.

author maintainer
#6 lore raw
In reply to Magnus Damm

Hi Simon,

Quoted 50 lines · Simon Horman
Quoted 49 lines · Magnus Damm
Quoted 47 lines · Simon Horman
Quoted 36 lines · Magnus Damm

Hi Simon,

Quoted 13 lines · Simon Horman
Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Quoted 8 lines
Quoted 4 lines

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

Thanks, that does seem to improve things a lot.
I can now boot all the way to a nfs userspace :^)

Yay!

Quoted 1 line

Thanks for testing!

Quoted 5 lines

I wonder if we should also add the following?

Fixes f2a5473861cf ("clocksource: sh_tmu: Set cpu_possible_mask to fix SMP broadcast")
Quoted 7 lines
Quoted 2 lines

For the record, I found that after I enabled CONFIG_SMSC_PHY the boot now gets as far as initialising SDHI.

Feel free to include any comment you think will help. My view is that the TMU commit pointed out by itself is not really troublesome, it is more that on legacy systems using earlytimer and TWD that this problem happens. For multiplatform the commit is fine.

From my point of view the patch mentioned caused a behavioural change on legacy systems which this patch addresses.

Quoted 6 lines
Quoted 1 line

Sure, I agree about that. =)

Excellent.

With the above in mind I will queue this up with the Fixes tag as a fix for v4.3. It may well filter into -stable from there.

Sounds good, thanks for your help!

/ magnus

#7 lore raw
In reply to Magnus Damm
Quoted 19 lines · Simon Horman
Quoted 18 lines · Magnus Damm
Quoted 17 lines · Simon Horman
Quoted 16 lines · Magnus Damm

Hi Simon,

Quoted 13 lines · Simon Horman
Quoted 12 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

With the above in mind I will queue this up with the Fixes tag as a fix for v4.3. It may well filter into -stable from there.

Before you tag it for stable: keeping in mind commit 30225743852ed5c3 ("ARM: shmobile: sh73a0 dtsi: Add Cortex-A9 TWD node), does it work with CONFIG_CPU_IDLE=y?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#8 lore raw
In reply to Magnus Damm

Hi Geert,

Quoted 23 lines · Geert Uytterhoeven
Quoted 22 lines · Simon Horman
Quoted 21 lines · Magnus Damm
Quoted 20 lines · Simon Horman
Quoted 19 lines · Magnus Damm

Hi Simon,

Quoted 16 lines · Simon Horman
Quoted 15 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

With the above in mind I will queue this up with the Fixes tag as a fix for v4.3. It may well filter into -stable from there.

Before you tag it for stable: keeping in mind commit 30225743852ed5c3 ("ARM: shmobile: sh73a0 dtsi: Add Cortex-A9 TWD node), does it work with CONFIG_CPU_IDLE=y?

CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y
CONFIG_DT_IDLE_STATES=y
CONFIG_ARM_CPUIDLE=y

I tried enabling the above and then tested booting the marzen board both with and without this patch (the one in the subject of the email).

The result was the same as without the above options enabled:

* The patch seems to be required for marzen to boot to any kind of console without CONFIG_DEBUG_LL set.

#9 lore raw
In reply to Magnus Damm

Hi SImon,

Quoted 39 lines · Simon Horman
Quoted 23 lines · Geert Uytterhoeven
Quoted 22 lines · Simon Horman
Quoted 21 lines · Magnus Damm
Quoted 20 lines · Simon Horman
Quoted 19 lines · Magnus Damm

Hi Simon,

Quoted 16 lines · Simon Horman
Quoted 15 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

With the above in mind I will queue this up with the Fixes tag as a fix for v4.3. It may well filter into -stable from there.

Before you tag it for stable: keeping in mind commit 30225743852ed5c3 ("ARM: shmobile: sh73a0 dtsi: Add Cortex-A9 TWD node), does it work with CONFIG_CPU_IDLE=y?

CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y
CONFIG_DT_IDLE_STATES=y
CONFIG_ARM_CPUIDLE=y

Quoted 7 lines

I tried enabling the above and then tested booting the marzen board both with and without this patch (the one in the subject of the email).

The result was the same as without the above options enabled:

* The patch seems to be required for marzen to boot to any kind of console without CONFIG_DEBUG_LL set.

OK, then I'd go for it!

Thanks for checking.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#10 lore raw
In reply to Magnus Damm
Quoted 8 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Quoted 8 lines

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

I currently have this patch queued up.
However, as "[PATCH 00/03] ARM: shmobile: r8a7779 Marzen legacy removal" is also queued up I have it in mind to drop this patch. The reasoning is twofold:

* There seems little benefit to fix legacy code that is being removed
* There is a tedious merge conflict between fixing and removing the code

#11 lore raw
In reply to Magnus Damm
Quoted 18 lines · Simon Horman
Quoted 8 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Unbreak the r8a7779 Marzen legacy code provided by marzen_defconfig.

As it is today Marzen multiplatform is working, but the legacy code is broken. This patch intends to leave multiplatform as-is but do a simple one-shot fix to unbreak the legacy code base.

Quoted 8 lines

Without this patch there is no preset delay and the TWD is defined both in C code and in DT. Solve the delay by invoking shmobile_init_delay() and simply disable TWD in case of building for legacy.

Marzen legacy code will be removed in the near future, but until then we may as well avoid breaking it.

Quoted 7 lines

I currently have this patch queued up.
However, as "[PATCH 00/03] ARM: shmobile: r8a7779 Marzen legacy removal" is also queued up I have it in mind to drop this patch. The reasoning is twofold:

* There seems little benefit to fix legacy code that is being removed
* There is a tedious merge conflict between fixing and removing the code

I have gone ahead and dropped this patch.