All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] ARM: shmobile: Move shmobile_scu_base from .text to .bss
  2016-02-19  6:09 [GIT PULL] Renesas ARM Based SoC Fixes for v4.5 Simon Horman
@ 2016-02-19  6:09   ` Simon Horman
  2016-02-19  6:09   ` Simon Horman
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-19  6:09 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Geert Uytterhoeven, Simon Horman

From: Geert Uytterhoeven <geert+renesas@glider.be>

shmobile_scu_base is being written to, so it doesn't belong in the .text
section. Fix this by moving it from asm .text to C .bss, as it's no
longer used from asm code since commit 4f6da36f7edd5790 ("ARM: shmobile:
Remove old SCU boot code").

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/headsmp-scu.S | 6 ------
 arch/arm/mach-shmobile/platsmp-scu.c | 3 +++
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-shmobile/headsmp-scu.S b/arch/arm/mach-shmobile/headsmp-scu.S
index fa5248c52399..5e503d91ad70 100644
--- a/arch/arm/mach-shmobile/headsmp-scu.S
+++ b/arch/arm/mach-shmobile/headsmp-scu.S
@@ -38,9 +38,3 @@ ENTRY(shmobile_boot_scu)
 
 	b	secondary_startup
 ENDPROC(shmobile_boot_scu)
-
-	.text
-	.align	2
-	.globl	shmobile_scu_base
-shmobile_scu_base:
-	.space	4
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
index 64663110ab6c..f2198c9c7435 100644
--- a/arch/arm/mach-shmobile/platsmp-scu.c
+++ b/arch/arm/mach-shmobile/platsmp-scu.c
@@ -17,6 +17,9 @@
 #include <asm/smp_scu.h>
 #include "common.h"
 
+
+void __iomem *shmobile_scu_base;
+
 static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb,
 					  unsigned long action, void *hcpu)
 {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 1/4] ARM: shmobile: Move shmobile_scu_base from .text to .bss
@ 2016-02-19  6:09   ` Simon Horman
  0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-19  6:09 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@glider.be>

shmobile_scu_base is being written to, so it doesn't belong in the .text
section. Fix this by moving it from asm .text to C .bss, as it's no
longer used from asm code since commit 4f6da36f7edd5790 ("ARM: shmobile:
Remove old SCU boot code").

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/headsmp-scu.S | 6 ------
 arch/arm/mach-shmobile/platsmp-scu.c | 3 +++
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-shmobile/headsmp-scu.S b/arch/arm/mach-shmobile/headsmp-scu.S
index fa5248c52399..5e503d91ad70 100644
--- a/arch/arm/mach-shmobile/headsmp-scu.S
+++ b/arch/arm/mach-shmobile/headsmp-scu.S
@@ -38,9 +38,3 @@ ENTRY(shmobile_boot_scu)
 
 	b	secondary_startup
 ENDPROC(shmobile_boot_scu)
-
-	.text
-	.align	2
-	.globl	shmobile_scu_base
-shmobile_scu_base:
-	.space	4
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
index 64663110ab6c..f2198c9c7435 100644
--- a/arch/arm/mach-shmobile/platsmp-scu.c
+++ b/arch/arm/mach-shmobile/platsmp-scu.c
@@ -17,6 +17,9 @@
 #include <asm/smp_scu.h>
 #include "common.h"
 
+
+void __iomem *shmobile_scu_base;
+
 static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb,
 					  unsigned long action, void *hcpu)
 {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/4] ARM: shmobile: r8a7779: Remove remainings of removed SCU boot setup code
  2016-02-19  6:09 [GIT PULL] Renesas ARM Based SoC Fixes for v4.5 Simon Horman
@ 2016-02-19  6:09   ` Simon Horman
  2016-02-19  6:09   ` Simon Horman
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-19  6:09 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Geert Uytterhoeven, Simon Horman

From: Geert Uytterhoeven <geert+renesas@glider.be>

Commit 0ca2894b5a900709 ("ARM: shmobile: Use shared SCU SMP boot code on
r8a7779") obsoleted the r8a7779-specific SCU boot code, but forgot to
remove the setup of shmobile_boot_fn and shmobile_boot_arg, which is
overwritten by shmobile_smp_scu_prepare_cpus().

Note that shmobile_scu_base wasn't initialized at that point yet anyway.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/smp-r8a7779.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index b854fe2095ad..0b024a9dbd43 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -92,8 +92,6 @@ static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
 {
 	/* Map the reset vector (in headsmp-scu.S, headsmp.S) */
 	__raw_writel(__pa(shmobile_boot_vector), AVECR);
-	shmobile_boot_fn = virt_to_phys(shmobile_boot_scu);
-	shmobile_boot_arg = (unsigned long)shmobile_scu_base;
 
 	/* setup r8a7779 specific SCU bits */
 	shmobile_scu_base = IOMEM(R8A7779_SCU_BASE);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/4] ARM: shmobile: r8a7779: Remove remainings of removed SCU boot setup code
@ 2016-02-19  6:09   ` Simon Horman
  0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-19  6:09 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@glider.be>

Commit 0ca2894b5a900709 ("ARM: shmobile: Use shared SCU SMP boot code on
r8a7779") obsoleted the r8a7779-specific SCU boot code, but forgot to
remove the setup of shmobile_boot_fn and shmobile_boot_arg, which is
overwritten by shmobile_smp_scu_prepare_cpus().

Note that shmobile_scu_base wasn't initialized at that point yet anyway.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/smp-r8a7779.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index b854fe2095ad..0b024a9dbd43 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -92,8 +92,6 @@ static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
 {
 	/* Map the reset vector (in headsmp-scu.S, headsmp.S) */
 	__raw_writel(__pa(shmobile_boot_vector), AVECR);
-	shmobile_boot_fn = virt_to_phys(shmobile_boot_scu);
-	shmobile_boot_arg = (unsigned long)shmobile_scu_base;
 
 	/* setup r8a7779 specific SCU bits */
 	shmobile_scu_base = IOMEM(R8A7779_SCU_BASE);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/4] ARM: shmobile: Move shmobile_smp_{mpidr, fn, arg}[] from .text to .bss
  2016-02-19  6:09 [GIT PULL] Renesas ARM Based SoC Fixes for v4.5 Simon Horman
@ 2016-02-19  6:09   ` Simon Horman
  2016-02-19  6:09   ` Simon Horman
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-19  6:09 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Geert Uytterhoeven, Simon Horman

From: Geert Uytterhoeven <geert+renesas@glider.be>

If CONFIG_DEBUG_RODATA=y, the kernel crashes during system suspend:

    Freezing user space processes ... (elapsed 0.004 seconds) done.
    Freezing remaining freezable tasks ... (elapsed 0.002 seconds)
    done.
    PM: suspend of devices complete after 111.948 msecs
    PM: late suspend of devices complete after 1.086 msecs
    PM: noirq suspend of devices complete after 11.576 msecs
    Disabling non-boot CPUs ...
    Kernel panic - not syncing: Attempted to kill the idle task!
    1014ec ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
    CPU0: stopping

This happens because the .text section is marked read-only, while the
arrays shmobile_smp_mpidr[], shmobile_smp_fn[], and shmobile_smp_arg[]
are being written to.

Fix this by moving these arrays from the .text to the .bss section.
This requires accessing them through PC-relative offsets.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/headsmp.S | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 330c1fc63197..94d86ed16414 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -50,9 +50,11 @@ ENTRY(shmobile_smp_boot)
 	mrc	p15, 0, r1, c0, c0, 5		@ r1 = MPIDR
 	and	r0, r1, r0			@ r0 = cpu_logical_map() value
 	mov	r1, #0				@ r1 = CPU index
-	adr	r5, 1f				@ array of per-cpu mpidr values
-	adr	r6, 2f				@ array of per-cpu functions
-	adr	r7, 3f				@ array of per-cpu arguments
+	adr	r2, 1f
+	ldmia	r2, {r5, r6, r7}
+	add	r5, r5, r2			@ array of per-cpu mpidr values
+	add	r6, r6, r2			@ array of per-cpu functions
+	add	r7, r7, r2			@ array of per-cpu arguments
 
 shmobile_smp_boot_find_mpidr:
 	ldr	r8, [r5, r1, lsl #2]
@@ -80,12 +82,18 @@ ENTRY(shmobile_smp_sleep)
 	b	shmobile_smp_boot
 ENDPROC(shmobile_smp_sleep)
 
+	.align	2
+1:	.long	shmobile_smp_mpidr - .
+	.long	shmobile_smp_fn - 1b
+	.long	shmobile_smp_arg - 1b
+
+	.bss
 	.globl	shmobile_smp_mpidr
 shmobile_smp_mpidr:
-1:	.space	NR_CPUS * 4
+	.space	NR_CPUS * 4
 	.globl	shmobile_smp_fn
 shmobile_smp_fn:
-2:	.space	NR_CPUS * 4
+	.space	NR_CPUS * 4
 	.globl	shmobile_smp_arg
 shmobile_smp_arg:
-3:	.space	NR_CPUS * 4
+	.space	NR_CPUS * 4
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [GIT PULL] Renesas ARM Based SoC Fixes for v4.5
@ 2016-02-19  6:09 Simon Horman
  2016-02-19  6:09   ` Simon Horman
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-19  6:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof, Hi Kevin, Hi Arnd,

Please consider these Renesas ARM based SoC fixes for v4.5.

This pull request is comprised of patches from Geert Uytterhoeven to avoid
writing to .text.

* "ARM: shmobile: Move shmobile_scu_base from .text to .bss"

  Resolves a problem for XIP kernels as writing to .text is not allowed.
  For non-XIP kernels a problem does not manifst as the pages are mapped
  read-only during late kernel startup.

* The remaining patches resolve a kernel-crash that occurs during system
  suspend for CONFIG_DEBUG_RODATA=y kernels.


The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d:

  Linux 4.5-rc1 (2016-01-24 13:06:47 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-soc-fixes-for-v4.5

for you to fetch changes up to 901c5ffaaed117a38be9d0c29247c4888d6c8636:

  ARM: shmobile: Remove shmobile_boot_arg (2016-02-17 18:27:21 +0900)

----------------------------------------------------------------
Renesas ARM Based SoC Fixes for v4.5

* Avoid writing to .text

----------------------------------------------------------------
Geert Uytterhoeven (4):
      ARM: shmobile: Move shmobile_scu_base from .text to .bss
      ARM: shmobile: r8a7779: Remove remainings of removed SCU boot setup code
      ARM: shmobile: Move shmobile_smp_{mpidr, fn, arg}[] from .text to .bss
      ARM: shmobile: Remove shmobile_boot_arg

 arch/arm/mach-shmobile/common.h       |  1 -
 arch/arm/mach-shmobile/headsmp-scu.S  |  6 ------
 arch/arm/mach-shmobile/headsmp.S      | 28 ++++++++++++++++------------
 arch/arm/mach-shmobile/platsmp-apmu.c |  1 -
 arch/arm/mach-shmobile/platsmp-scu.c  |  4 +++-
 arch/arm/mach-shmobile/smp-r8a7779.c  |  2 --
 6 files changed, 19 insertions(+), 23 deletions(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 3/4] ARM: shmobile: Move shmobile_smp_{mpidr, fn, arg}[] from .text to .bss
@ 2016-02-19  6:09   ` Simon Horman
  0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-19  6:09 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@glider.be>

If CONFIG_DEBUG_RODATA=y, the kernel crashes during system suspend:

    Freezing user space processes ... (elapsed 0.004 seconds) done.
    Freezing remaining freezable tasks ... (elapsed 0.002 seconds)
    done.
    PM: suspend of devices complete after 111.948 msecs
    PM: late suspend of devices complete after 1.086 msecs
    PM: noirq suspend of devices complete after 11.576 msecs
    Disabling non-boot CPUs ...
    Kernel panic - not syncing: Attempted to kill the idle task!
    1014ec ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
    CPU0: stopping

This happens because the .text section is marked read-only, while the
arrays shmobile_smp_mpidr[], shmobile_smp_fn[], and shmobile_smp_arg[]
are being written to.

Fix this by moving these arrays from the .text to the .bss section.
This requires accessing them through PC-relative offsets.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/headsmp.S | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 330c1fc63197..94d86ed16414 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -50,9 +50,11 @@ ENTRY(shmobile_smp_boot)
 	mrc	p15, 0, r1, c0, c0, 5		@ r1 = MPIDR
 	and	r0, r1, r0			@ r0 = cpu_logical_map() value
 	mov	r1, #0				@ r1 = CPU index
-	adr	r5, 1f				@ array of per-cpu mpidr values
-	adr	r6, 2f				@ array of per-cpu functions
-	adr	r7, 3f				@ array of per-cpu arguments
+	adr	r2, 1f
+	ldmia	r2, {r5, r6, r7}
+	add	r5, r5, r2			@ array of per-cpu mpidr values
+	add	r6, r6, r2			@ array of per-cpu functions
+	add	r7, r7, r2			@ array of per-cpu arguments
 
 shmobile_smp_boot_find_mpidr:
 	ldr	r8, [r5, r1, lsl #2]
@@ -80,12 +82,18 @@ ENTRY(shmobile_smp_sleep)
 	b	shmobile_smp_boot
 ENDPROC(shmobile_smp_sleep)
 
+	.align	2
+1:	.long	shmobile_smp_mpidr - .
+	.long	shmobile_smp_fn - 1b
+	.long	shmobile_smp_arg - 1b
+
+	.bss
 	.globl	shmobile_smp_mpidr
 shmobile_smp_mpidr:
-1:	.space	NR_CPUS * 4
+	.space	NR_CPUS * 4
 	.globl	shmobile_smp_fn
 shmobile_smp_fn:
-2:	.space	NR_CPUS * 4
+	.space	NR_CPUS * 4
 	.globl	shmobile_smp_arg
 shmobile_smp_arg:
-3:	.space	NR_CPUS * 4
+	.space	NR_CPUS * 4
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/4] ARM: shmobile: Remove shmobile_boot_arg
  2016-02-19  6:09 [GIT PULL] Renesas ARM Based SoC Fixes for v4.5 Simon Horman
@ 2016-02-19  6:09   ` Simon Horman
  2016-02-19  6:09   ` Simon Horman
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-19  6:09 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Geert Uytterhoeven, Simon Horman

From: Geert Uytterhoeven <geert+renesas@glider.be>

CPU boot configuration writes to shmobile_boot_arg, which is located in
the .text section, and thus should not be written to.

As of commit 1d33a354bbb618ba ("ARM: shmobile: Per-CPU SMP boot / sleep
code for SCU SoCs"), and ignoring accidental remainings,
shmobile_boot_arg is always set to MPIDR_HWID_BITMASK by C code.
Hence we can just hardcode this in the assembler code, and remove the
variable, and thus also remove the need to write to this variable.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/common.h       | 1 -
 arch/arm/mach-shmobile/headsmp.S      | 8 ++------
 arch/arm/mach-shmobile/platsmp-apmu.c | 1 -
 arch/arm/mach-shmobile/platsmp-scu.c  | 1 -
 4 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index 9cb11215ceba..b3a4ed5289ec 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -4,7 +4,6 @@
 extern void shmobile_init_delay(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
-extern unsigned long shmobile_boot_arg;
 extern unsigned long shmobile_boot_size;
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 94d86ed16414..32e0bf6e3ccb 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -24,7 +24,6 @@
 	.arm
 	.align  12
 ENTRY(shmobile_boot_vector)
-	ldr     r0, 2f
 	ldr     r1, 1f
 	bx	r1
 
@@ -34,9 +33,6 @@ ENDPROC(shmobile_boot_vector)
 	.globl	shmobile_boot_fn
 shmobile_boot_fn:
 1:	.space	4
-	.globl	shmobile_boot_arg
-shmobile_boot_arg:
-2:	.space	4
 	.globl	shmobile_boot_size
 shmobile_boot_size:
 	.long	. - shmobile_boot_vector
@@ -46,9 +42,9 @@ shmobile_boot_size:
  */
 
 ENTRY(shmobile_smp_boot)
-						@ r0 = MPIDR_HWID_BITMASK
 	mrc	p15, 0, r1, c0, c0, 5		@ r1 = MPIDR
-	and	r0, r1, r0			@ r0 = cpu_logical_map() value
+	and	r0, r1, #0xffffff		@ MPIDR_HWID_BITMASK
+						@ r0 = cpu_logical_map() value
 	mov	r1, #0				@ r1 = CPU index
 	adr	r2, 1f
 	ldmia	r2, {r5, r6, r7}
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 911884f7e28b..aba75c89f9c1 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -123,7 +123,6 @@ void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
 {
 	/* install boot code shared by all CPUs */
 	shmobile_boot_fn = virt_to_phys(shmobile_smp_boot);
-	shmobile_boot_arg = MPIDR_HWID_BITMASK;
 
 	/* perform per-cpu setup */
 	apmu_parse_cfg(apmu_init_cpu, apmu_config, num);
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
index f2198c9c7435..081a097c9219 100644
--- a/arch/arm/mach-shmobile/platsmp-scu.c
+++ b/arch/arm/mach-shmobile/platsmp-scu.c
@@ -44,7 +44,6 @@ void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus)
 {
 	/* install boot code shared by all CPUs */
 	shmobile_boot_fn = virt_to_phys(shmobile_smp_boot);
-	shmobile_boot_arg = MPIDR_HWID_BITMASK;
 
 	/* enable SCU and cache coherency on booting CPU */
 	scu_enable(shmobile_scu_base);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/4] ARM: shmobile: Remove shmobile_boot_arg
@ 2016-02-19  6:09   ` Simon Horman
  0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-19  6:09 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@glider.be>

CPU boot configuration writes to shmobile_boot_arg, which is located in
the .text section, and thus should not be written to.

As of commit 1d33a354bbb618ba ("ARM: shmobile: Per-CPU SMP boot / sleep
code for SCU SoCs"), and ignoring accidental remainings,
shmobile_boot_arg is always set to MPIDR_HWID_BITMASK by C code.
Hence we can just hardcode this in the assembler code, and remove the
variable, and thus also remove the need to write to this variable.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/common.h       | 1 -
 arch/arm/mach-shmobile/headsmp.S      | 8 ++------
 arch/arm/mach-shmobile/platsmp-apmu.c | 1 -
 arch/arm/mach-shmobile/platsmp-scu.c  | 1 -
 4 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index 9cb11215ceba..b3a4ed5289ec 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -4,7 +4,6 @@
 extern void shmobile_init_delay(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
-extern unsigned long shmobile_boot_arg;
 extern unsigned long shmobile_boot_size;
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 94d86ed16414..32e0bf6e3ccb 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -24,7 +24,6 @@
 	.arm
 	.align  12
 ENTRY(shmobile_boot_vector)
-	ldr     r0, 2f
 	ldr     r1, 1f
 	bx	r1
 
@@ -34,9 +33,6 @@ ENDPROC(shmobile_boot_vector)
 	.globl	shmobile_boot_fn
 shmobile_boot_fn:
 1:	.space	4
-	.globl	shmobile_boot_arg
-shmobile_boot_arg:
-2:	.space	4
 	.globl	shmobile_boot_size
 shmobile_boot_size:
 	.long	. - shmobile_boot_vector
@@ -46,9 +42,9 @@ shmobile_boot_size:
  */
 
 ENTRY(shmobile_smp_boot)
-						@ r0 = MPIDR_HWID_BITMASK
 	mrc	p15, 0, r1, c0, c0, 5		@ r1 = MPIDR
-	and	r0, r1, r0			@ r0 = cpu_logical_map() value
+	and	r0, r1, #0xffffff		@ MPIDR_HWID_BITMASK
+						@ r0 = cpu_logical_map() value
 	mov	r1, #0				@ r1 = CPU index
 	adr	r2, 1f
 	ldmia	r2, {r5, r6, r7}
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 911884f7e28b..aba75c89f9c1 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -123,7 +123,6 @@ void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
 {
 	/* install boot code shared by all CPUs */
 	shmobile_boot_fn = virt_to_phys(shmobile_smp_boot);
-	shmobile_boot_arg = MPIDR_HWID_BITMASK;
 
 	/* perform per-cpu setup */
 	apmu_parse_cfg(apmu_init_cpu, apmu_config, num);
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
index f2198c9c7435..081a097c9219 100644
--- a/arch/arm/mach-shmobile/platsmp-scu.c
+++ b/arch/arm/mach-shmobile/platsmp-scu.c
@@ -44,7 +44,6 @@ void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus)
 {
 	/* install boot code shared by all CPUs */
 	shmobile_boot_fn = virt_to_phys(shmobile_smp_boot);
-	shmobile_boot_arg = MPIDR_HWID_BITMASK;
 
 	/* enable SCU and cache coherency on booting CPU */
 	scu_enable(shmobile_scu_base);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [GIT PULL] Renesas ARM Based SoC Fixes for v4.5
  2016-02-19  6:09 [GIT PULL] Renesas ARM Based SoC Fixes for v4.5 Simon Horman
                   ` (3 preceding siblings ...)
  2016-02-19  6:09   ` Simon Horman
@ 2016-02-24  8:08 ` Olof Johansson
  2016-02-24  8:37   ` Geert Uytterhoeven
  4 siblings, 1 reply; 16+ messages in thread
From: Olof Johansson @ 2016-02-24  8:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 19, 2016 at 03:09:46PM +0900, Simon Horman wrote:
> Hi Olof, Hi Kevin, Hi Arnd,
> 
> Please consider these Renesas ARM based SoC fixes for v4.5.
> 
> This pull request is comprised of patches from Geert Uytterhoeven to avoid
> writing to .text.
> 
> * "ARM: shmobile: Move shmobile_scu_base from .text to .bss"
> 
>   Resolves a problem for XIP kernels as writing to .text is not allowed.
>   For non-XIP kernels a problem does not manifst as the pages are mapped
>   read-only during late kernel startup.
> 
> * The remaining patches resolve a kernel-crash that occurs during system
>   suspend for CONFIG_DEBUG_RODATA=y kernels.
> 
> 
> The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d:
> 
>   Linux 4.5-rc1 (2016-01-24 13:06:47 -0800)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-soc-fixes-for-v4.5
> 
> for you to fetch changes up to 901c5ffaaed117a38be9d0c29247c4888d6c8636:
> 
>   ARM: shmobile: Remove shmobile_boot_arg (2016-02-17 18:27:21 +0900)

Hi Simon, Geert,

I don't think any of these fixes are for regressions, are they? I.e. this is
work to enable configs that never used to work (XIP, CONFIG_DEBUG_RODATA)?


-Olof

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [GIT PULL] Renesas ARM Based SoC Fixes for v4.5
  2016-02-24  8:08 ` [GIT PULL] Renesas ARM Based SoC Fixes for v4.5 Olof Johansson
@ 2016-02-24  8:37   ` Geert Uytterhoeven
  2016-02-24 16:48     ` Olof Johansson
  0 siblings, 1 reply; 16+ messages in thread
From: Geert Uytterhoeven @ 2016-02-24  8:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof,

On Wed, Feb 24, 2016 at 9:08 AM, Olof Johansson <olof@lixom.net> wrote:
> On Fri, Feb 19, 2016 at 03:09:46PM +0900, Simon Horman wrote:
>> Please consider these Renesas ARM based SoC fixes for v4.5.
>>
>> This pull request is comprised of patches from Geert Uytterhoeven to avoid
>> writing to .text.
>>
>> * "ARM: shmobile: Move shmobile_scu_base from .text to .bss"
>>
>>   Resolves a problem for XIP kernels as writing to .text is not allowed.
>>   For non-XIP kernels a problem does not manifst as the pages are mapped
>>   read-only during late kernel startup.
>>
>> * The remaining patches resolve a kernel-crash that occurs during system
>>   suspend for CONFIG_DEBUG_RODATA=y kernels.
>>
>>
>> The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d:
>>
>>   Linux 4.5-rc1 (2016-01-24 13:06:47 -0800)
>>
>> are available in the git repository at:
>>
>>   git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-soc-fixes-for-v4.5
>>
>> for you to fetch changes up to 901c5ffaaed117a38be9d0c29247c4888d6c8636:
>>
>>   ARM: shmobile: Remove shmobile_boot_arg (2016-02-17 18:27:21 +0900)
>
> Hi Simon, Geert,
>
> I don't think any of these fixes are for regressions, are they? I.e. this is
> work to enable configs that never used to work (XIP, CONFIG_DEBUG_RODATA)?

These configs indeed never worked before.

However,

commit 25362dc496edaf17f714c0fecd8b3eb79670207b
Author: Kees Cook <keescook@chromium.org>
Date:   Tue Jan 26 01:19:36 2016 +0100

    ARM: 8501/1: mm: flip priority of CONFIG_DEBUG_RODATA

in arm/for-next will enable CONFIG_DEBUG_RODATA by default.

Not having the fixes in v4.5 means that if Russell's tree is merged
into mainline
for v4.6 before arm-soc, it will cause regressions and bisection issues.

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [GIT PULL] Renesas ARM Based SoC Fixes for v4.5
  2016-02-24  8:37   ` Geert Uytterhoeven
@ 2016-02-24 16:48     ` Olof Johansson
  2016-02-24 23:59       ` Simon Horman
  0 siblings, 1 reply; 16+ messages in thread
From: Olof Johansson @ 2016-02-24 16:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 24, 2016 at 12:37 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> Hi Olof,
>
> On Wed, Feb 24, 2016 at 9:08 AM, Olof Johansson <olof@lixom.net> wrote:
>> On Fri, Feb 19, 2016 at 03:09:46PM +0900, Simon Horman wrote:
>>> Please consider these Renesas ARM based SoC fixes for v4.5.
>>>
>>> This pull request is comprised of patches from Geert Uytterhoeven to avoid
>>> writing to .text.
>>>
>>> * "ARM: shmobile: Move shmobile_scu_base from .text to .bss"
>>>
>>>   Resolves a problem for XIP kernels as writing to .text is not allowed.
>>>   For non-XIP kernels a problem does not manifst as the pages are mapped
>>>   read-only during late kernel startup.
>>>
>>> * The remaining patches resolve a kernel-crash that occurs during system
>>>   suspend for CONFIG_DEBUG_RODATA=y kernels.
>>>
>>>
>>> The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d:
>>>
>>>   Linux 4.5-rc1 (2016-01-24 13:06:47 -0800)
>>>
>>> are available in the git repository at:
>>>
>>>   git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-soc-fixes-for-v4.5
>>>
>>> for you to fetch changes up to 901c5ffaaed117a38be9d0c29247c4888d6c8636:
>>>
>>>   ARM: shmobile: Remove shmobile_boot_arg (2016-02-17 18:27:21 +0900)
>>
>> Hi Simon, Geert,
>>
>> I don't think any of these fixes are for regressions, are they? I.e. this is
>> work to enable configs that never used to work (XIP, CONFIG_DEBUG_RODATA)?
>
> These configs indeed never worked before.
>
> However,
>
> commit 25362dc496edaf17f714c0fecd8b3eb79670207b
> Author: Kees Cook <keescook@chromium.org>
> Date:   Tue Jan 26 01:19:36 2016 +0100
>
>     ARM: 8501/1: mm: flip priority of CONFIG_DEBUG_RODATA
>
> in arm/for-next will enable CONFIG_DEBUG_RODATA by default.
>
> Not having the fixes in v4.5 means that if Russell's tree is merged
> into mainline
> for v4.6 before arm-soc, it will cause regressions and bisection issues.

Ok, either way there'll be windows in which bisect will fail since the
changes are on independent branches.

Based on that, and looking at the patches, I'll pick it up now for fixes.


-Olof

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [GIT PULL] Renesas ARM Based SoC Fixes for v4.5
  2016-02-24 16:48     ` Olof Johansson
@ 2016-02-24 23:59       ` Simon Horman
  0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-02-24 23:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 24, 2016 at 08:48:08AM -0800, Olof Johansson wrote:
> On Wed, Feb 24, 2016 at 12:37 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > Hi Olof,
> >
> > On Wed, Feb 24, 2016 at 9:08 AM, Olof Johansson <olof@lixom.net> wrote:
> >> On Fri, Feb 19, 2016 at 03:09:46PM +0900, Simon Horman wrote:
> >>> Please consider these Renesas ARM based SoC fixes for v4.5.
> >>>
> >>> This pull request is comprised of patches from Geert Uytterhoeven to avoid
> >>> writing to .text.
> >>>
> >>> * "ARM: shmobile: Move shmobile_scu_base from .text to .bss"
> >>>
> >>>   Resolves a problem for XIP kernels as writing to .text is not allowed.
> >>>   For non-XIP kernels a problem does not manifst as the pages are mapped
> >>>   read-only during late kernel startup.
> >>>
> >>> * The remaining patches resolve a kernel-crash that occurs during system
> >>>   suspend for CONFIG_DEBUG_RODATA=y kernels.
> >>>
> >>>
> >>> The following changes since commit 92e963f50fc74041b5e9e744c330dca48e04f08d:
> >>>
> >>>   Linux 4.5-rc1 (2016-01-24 13:06:47 -0800)
> >>>
> >>> are available in the git repository at:
> >>>
> >>>   git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-soc-fixes-for-v4.5
> >>>
> >>> for you to fetch changes up to 901c5ffaaed117a38be9d0c29247c4888d6c8636:
> >>>
> >>>   ARM: shmobile: Remove shmobile_boot_arg (2016-02-17 18:27:21 +0900)
> >>
> >> Hi Simon, Geert,
> >>
> >> I don't think any of these fixes are for regressions, are they? I.e. this is
> >> work to enable configs that never used to work (XIP, CONFIG_DEBUG_RODATA)?
> >
> > These configs indeed never worked before.
> >
> > However,
> >
> > commit 25362dc496edaf17f714c0fecd8b3eb79670207b
> > Author: Kees Cook <keescook@chromium.org>
> > Date:   Tue Jan 26 01:19:36 2016 +0100
> >
> >     ARM: 8501/1: mm: flip priority of CONFIG_DEBUG_RODATA
> >
> > in arm/for-next will enable CONFIG_DEBUG_RODATA by default.
> >
> > Not having the fixes in v4.5 means that if Russell's tree is merged
> > into mainline
> > for v4.6 before arm-soc, it will cause regressions and bisection issues.
> 
> Ok, either way there'll be windows in which bisect will fail since the
> changes are on independent branches.
> 
> Based on that, and looking at the patches, I'll pick it up now for fixes.

Thanks Olof, much appreciated.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [GIT PULL] Renesas ARM Based SoC Fixes for v4.5
  2016-01-22 16:30 ` Olof Johansson
@ 2016-01-24 23:45   ` Simon Horman
  0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2016-01-24 23:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 22, 2016 at 08:30:48AM -0800, Olof Johansson wrote:
> On Wed, Jan 20, 2016 at 6:41 PM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > Hi Olof, Hi Kevin, Hi Arnd,
> >
> > Please consider these Renesas ARM based SoC fixes for v4.5.
> >
> > This corrects the extal1 frequency on the armadillo800eva board.
> > This problem seems to have been around for a while and I would
> > like it considered for stable.
> 
> 
> If you want it for stable you should cc stable in the
> signed-off-series, or send it separately to Greg. We usually don't
> filter out on our own due to volume.

Thanks, got it.

> Merged the branch. Thanks!

Great, thanks.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [GIT PULL] Renesas ARM Based SoC Fixes for v4.5
  2016-01-21  2:41 Simon Horman
@ 2016-01-22 16:30 ` Olof Johansson
  2016-01-24 23:45   ` Simon Horman
  0 siblings, 1 reply; 16+ messages in thread
From: Olof Johansson @ 2016-01-22 16:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 20, 2016 at 6:41 PM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> Hi Olof, Hi Kevin, Hi Arnd,
>
> Please consider these Renesas ARM based SoC fixes for v4.5.
>
> This corrects the extal1 frequency on the armadillo800eva board.
> This problem seems to have been around for a while and I would
> like it considered for stable.


If you want it for stable you should cc stable in the
signed-off-series, or send it separately to Greg. We usually don't
filter out on our own due to volume.

Merged the branch. Thanks!


-Olof

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [GIT PULL] Renesas ARM Based SoC Fixes for v4.5
@ 2016-01-21  2:41 Simon Horman
  2016-01-22 16:30 ` Olof Johansson
  0 siblings, 1 reply; 16+ messages in thread
From: Simon Horman @ 2016-01-21  2:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof, Hi Kevin, Hi Arnd,

Please consider these Renesas ARM based SoC fixes for v4.5.

This corrects the extal1 frequency on the armadillo800eva board.
This problem seems to have been around for a while and I would
like it considered for stable.


The following changes since commit 8005c49d9aea74d382f474ce11afbbc7d7130bec:

  Linux 4.4-rc1 (2015-11-15 17:00:27 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-fixes-for-v4.5

for you to fetch changes up to c61f30a255550bbfc6b83c1ca720661489cac4c0:

  ARM: dts: armadillo800eva Correct extal1 frequency to 24 MHz (2016-01-18 11:17:49 +0900)

----------------------------------------------------------------
Renesas ARM Based SoC Fixes for v4.5

Correct extal1 frequency of armadillo800eva board

----------------------------------------------------------------
Geert Uytterhoeven (1):
      ARM: dts: armadillo800eva Correct extal1 frequency to 24 MHz

 arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-02-24 23:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-19  6:09 [GIT PULL] Renesas ARM Based SoC Fixes for v4.5 Simon Horman
2016-02-19  6:09 ` [PATCH 1/4] ARM: shmobile: Move shmobile_scu_base from .text to .bss Simon Horman
2016-02-19  6:09   ` Simon Horman
2016-02-19  6:09 ` [PATCH 2/4] ARM: shmobile: r8a7779: Remove remainings of removed SCU boot setup code Simon Horman
2016-02-19  6:09   ` Simon Horman
2016-02-19  6:09 ` [PATCH 3/4] ARM: shmobile: Move shmobile_smp_{mpidr, fn, arg}[] from .text to .bss Simon Horman
2016-02-19  6:09   ` Simon Horman
2016-02-19  6:09 ` [PATCH 4/4] ARM: shmobile: Remove shmobile_boot_arg Simon Horman
2016-02-19  6:09   ` Simon Horman
2016-02-24  8:08 ` [GIT PULL] Renesas ARM Based SoC Fixes for v4.5 Olof Johansson
2016-02-24  8:37   ` Geert Uytterhoeven
2016-02-24 16:48     ` Olof Johansson
2016-02-24 23:59       ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2016-01-21  2:41 Simon Horman
2016-01-22 16:30 ` Olof Johansson
2016-01-24 23:45   ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.