* [PATCH 1/3] ARM: tegra: fix build error when THUMB2_KERNEL enabled
@ 2013-04-15 12:42 Joseph Lo
2013-04-15 12:42 ` [PATCH 2/3] ARM: tegra: fix relocation truncated " Joseph Lo
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Joseph Lo @ 2013-04-15 12:42 UTC (permalink / raw)
To: linux-arm-kernel
This patch fix the build failure when CONFIG_THUBM2_KERNEL enabled. You
clould see the error message below:
arch/arm/mach-tegra/sleep-tegra30.S:69: Error: shift must be constant --
`orr r12,r12,r4,lsl r3'
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Joseph Lo <josephl@nvidia.com>
---
arch/arm/mach-tegra/sleep-tegra30.S | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-tegra/sleep-tegra30.S b/arch/arm/mach-tegra/sleep-tegra30.S
index 63a15bd..d29dfcc 100644
--- a/arch/arm/mach-tegra/sleep-tegra30.S
+++ b/arch/arm/mach-tegra/sleep-tegra30.S
@@ -66,7 +66,9 @@ ENTRY(tegra30_cpu_shutdown)
FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG | \
FLOW_CTRL_CSR_ENABLE
mov r4, #(1 << 4)
- orr r12, r12, r4, lsl r3
+ ARM( orr r12, r12, r4, lsl r3 )
+ THUMB( lsl r4, r4, r3 )
+ THUMB( orr r12, r12, r4 )
str r12, [r1]
/* Halt this CPU. */
--
1.8.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/3] ARM: tegra: fix relocation truncated error when THUMB2_KERNEL enabled
2013-04-15 12:42 [PATCH 1/3] ARM: tegra: fix build error when THUMB2_KERNEL enabled Joseph Lo
@ 2013-04-15 12:42 ` Joseph Lo
2013-04-15 12:42 ` [PATCH 3/3] ARM: tegra: make sure the pointer on 4 byte align " Joseph Lo
2013-04-15 22:51 ` [PATCH 1/3] ARM: tegra: fix build error " Stephen Warren
2 siblings, 0 replies; 7+ messages in thread
From: Joseph Lo @ 2013-04-15 12:42 UTC (permalink / raw)
To: linux-arm-kernel
The conditional branch instruction in Thumb2 only available to short range.
The linker will fail when the conditional branch over the range. Then
resulting in link error when generating kernel image. e.g.:
arch/arm/mach-tegra/reset-handler.S:47:(.text+0xf8e):
relocation truncated to fit: R_ARM_THM_JUMP19 against symbol
`cpu_resume' defined in .data section in arch/arm/kernel/built-in.o
This patch using a Thumb2 instruction IT (if-then) to have a longer branch
range.
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Joseph Lo <josephl@nvidia.com>
---
arch/arm/mach-tegra/reset-handler.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index 1676aba..e6de88a 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -44,6 +44,7 @@ ENTRY(tegra_resume)
cpu_id r0
cmp r0, #0 @ CPU0?
+ THUMB( it ne )
bne cpu_resume @ no
#ifdef CONFIG_ARCH_TEGRA_3x_SOC
--
1.8.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] ARM: tegra: make sure the pointer on 4 byte align when THUMB2_KERNEL enabled
2013-04-15 12:42 [PATCH 1/3] ARM: tegra: fix build error when THUMB2_KERNEL enabled Joseph Lo
2013-04-15 12:42 ` [PATCH 2/3] ARM: tegra: fix relocation truncated " Joseph Lo
@ 2013-04-15 12:42 ` Joseph Lo
2013-04-15 22:51 ` [PATCH 1/3] ARM: tegra: fix build error " Stephen Warren
2 siblings, 0 replies; 7+ messages in thread
From: Joseph Lo @ 2013-04-15 12:42 UTC (permalink / raw)
To: linux-arm-kernel
When building kernel with CONFIG_THUMB2_KERNEL, the data pointer in the
assembly may not on the 4 byte alignment. Then causing a data abort when
accessing the pointer. This patch add a ".align" flag in the head of the
pointer. And always using 32-bit ADR Thumb instruction to make sure it
won't build failure.
Signed-off-by: Joseph Lo <josephl@nvidia.com>
---
arch/arm/mach-tegra/reset-handler.S | 1 +
arch/arm/mach-tegra/sleep.h | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index e6de88a..519a8c5 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -83,6 +83,7 @@ ENDPROC(tegra_resume)
#ifdef CONFIG_CACHE_L2X0
.globl l2x0_saved_regs_addr
+ .align
l2x0_saved_regs_addr:
.long 0
#endif
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index 970ebd5..73a49b7 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -92,7 +92,8 @@
#ifdef CONFIG_CACHE_L2X0
.macro l2_cache_resume, tmp1, tmp2, tmp3, phys_l2x0_saved_regs
- adr \tmp1, \phys_l2x0_saved_regs
+ ARM( adr \tmp1, \phys_l2x0_saved_regs )
+ THUMB( adr.w \tmp1, \phys_l2x0_saved_regs )
ldr \tmp1, [\tmp1]
ldr \tmp2, [\tmp1, #L2X0_R_PHY_BASE]
ldr \tmp3, [\tmp2, #L2X0_CTRL]
--
1.8.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/3] ARM: tegra: fix build error when THUMB2_KERNEL enabled
2013-04-15 12:42 [PATCH 1/3] ARM: tegra: fix build error when THUMB2_KERNEL enabled Joseph Lo
2013-04-15 12:42 ` [PATCH 2/3] ARM: tegra: fix relocation truncated " Joseph Lo
2013-04-15 12:42 ` [PATCH 3/3] ARM: tegra: make sure the pointer on 4 byte align " Joseph Lo
@ 2013-04-15 22:51 ` Stephen Warren
2 siblings, 0 replies; 7+ messages in thread
From: Stephen Warren @ 2013-04-15 22:51 UTC (permalink / raw)
To: linux-arm-kernel
On 04/15/2013 06:42 AM, Joseph Lo wrote:
> This patch fix the build failure when CONFIG_THUBM2_KERNEL enabled. You
> clould see the error message below:
>
> arch/arm/mach-tegra/sleep-tegra30.S:69: Error: shift must be constant --
> `orr r12,r12,r4,lsl r3'
I have forwarded the series to the arm-soc maintainers to be applied
there. Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] ARM: tegra: fix build error when THUMB2_KERNEL enabled
@ 2013-04-15 22:50 Stephen Warren
2013-04-15 22:50 ` [PATCH 2/3] ARM: tegra: fix relocation truncated " Stephen Warren
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Warren @ 2013-04-15 22:50 UTC (permalink / raw)
To: linux-arm-kernel
From: Joseph Lo <josephl@nvidia.com>
This patch fix the build failure when CONFIG_THUBM2_KERNEL enabled. You
clould see the error message below:
arch/arm/mach-tegra/sleep-tegra30.S:69: Error: shift must be constant --
`orr r12,r12,r4,lsl r3'
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
Arnd, Olof, here are 3 fixes from Joseph for some Tegra build issues,
mostly exposed by multi-platform enablement and/or related randconfig
testing.
Can you please apply these to arm-soc? For reference, I tested applying
them to Tegra's for-3.10/fixes branch and they apply there fine, and
merge with the other Tegra for-3.10 branches at least, without any issue.
Note: patch 3 triggers checkpatch, but I can't work out why; the code
seems to be formatted the same as patch 1 and 2, and is consistent with
other usage of ARM() and THUMB() macros in arch/arm/.
arch/arm/mach-tegra/sleep-tegra30.S | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-tegra/sleep-tegra30.S b/arch/arm/mach-tegra/sleep-tegra30.S
index 63a15bd..d29dfcc 100644
--- a/arch/arm/mach-tegra/sleep-tegra30.S
+++ b/arch/arm/mach-tegra/sleep-tegra30.S
@@ -66,7 +66,9 @@ ENTRY(tegra30_cpu_shutdown)
FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG | \
FLOW_CTRL_CSR_ENABLE
mov r4, #(1 << 4)
- orr r12, r12, r4, lsl r3
+ ARM( orr r12, r12, r4, lsl r3 )
+ THUMB( lsl r4, r4, r3 )
+ THUMB( orr r12, r12, r4 )
str r12, [r1]
/* Halt this CPU. */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] ARM: tegra: fix relocation truncated error when THUMB2_KERNEL enabled
2013-04-15 22:50 Stephen Warren
@ 2013-04-15 22:50 ` Stephen Warren
2013-04-17 17:01 ` Dave Martin
2013-04-18 16:32 ` Olof Johansson
0 siblings, 2 replies; 7+ messages in thread
From: Stephen Warren @ 2013-04-15 22:50 UTC (permalink / raw)
To: linux-arm-kernel
From: Joseph Lo <josephl@nvidia.com>
The conditional branch instruction in Thumb2 only available to short range.
The linker will fail when the conditional branch over the range. Then
resulting in link error when generating kernel image. e.g.:
arch/arm/mach-tegra/reset-handler.S:47:(.text+0xf8e):
relocation truncated to fit: R_ARM_THM_JUMP19 against symbol
`cpu_resume' defined in .data section in arch/arm/kernel/built-in.o
This patch using a Thumb2 instruction IT (if-then) to have a longer branch
range.
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
arch/arm/mach-tegra/reset-handler.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index 1676aba..e6de88a 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -44,6 +44,7 @@ ENTRY(tegra_resume)
cpu_id r0
cmp r0, #0 @ CPU0?
+ THUMB( it ne )
bne cpu_resume @ no
#ifdef CONFIG_ARCH_TEGRA_3x_SOC
--
1.7.10.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] ARM: tegra: fix relocation truncated error when THUMB2_KERNEL enabled
2013-04-15 22:50 ` [PATCH 2/3] ARM: tegra: fix relocation truncated " Stephen Warren
@ 2013-04-17 17:01 ` Dave Martin
2013-04-18 16:32 ` Olof Johansson
1 sibling, 0 replies; 7+ messages in thread
From: Dave Martin @ 2013-04-17 17:01 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 15, 2013 at 04:50:54PM -0600, Stephen Warren wrote:
> From: Joseph Lo <josephl@nvidia.com>
>
> The conditional branch instruction in Thumb2 only available to short range.
> The linker will fail when the conditional branch over the range. Then
> resulting in link error when generating kernel image. e.g.:
>
> arch/arm/mach-tegra/reset-handler.S:47:(.text+0xf8e):
> relocation truncated to fit: R_ARM_THM_JUMP19 against symbol
> `cpu_resume' defined in .data section in arch/arm/kernel/built-in.o
>
> This patch using a Thumb2 instruction IT (if-then) to have a longer branch
> range.
>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Joseph Lo <josephl@nvidia.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
FWIW, Reviewed-by: Dave Martin <dave.martin@linaro.org>
> ---
> arch/arm/mach-tegra/reset-handler.S | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
> index 1676aba..e6de88a 100644
> --- a/arch/arm/mach-tegra/reset-handler.S
> +++ b/arch/arm/mach-tegra/reset-handler.S
> @@ -44,6 +44,7 @@ ENTRY(tegra_resume)
>
> cpu_id r0
> cmp r0, #0 @ CPU0?
> + THUMB( it ne )
> bne cpu_resume @ no
>
> #ifdef CONFIG_ARCH_TEGRA_3x_SOC
> --
> 1.7.10.4
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] ARM: tegra: fix relocation truncated error when THUMB2_KERNEL enabled
2013-04-15 22:50 ` [PATCH 2/3] ARM: tegra: fix relocation truncated " Stephen Warren
2013-04-17 17:01 ` Dave Martin
@ 2013-04-18 16:32 ` Olof Johansson
1 sibling, 0 replies; 7+ messages in thread
From: Olof Johansson @ 2013-04-18 16:32 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 15, 2013 at 04:50:54PM -0600, Stephen Warren wrote:
> From: Joseph Lo <josephl@nvidia.com>
>
> The conditional branch instruction in Thumb2 only available to short range.
> The linker will fail when the conditional branch over the range. Then
> resulting in link error when generating kernel image. e.g.:
>
> arch/arm/mach-tegra/reset-handler.S:47:(.text+0xf8e):
> relocation truncated to fit: R_ARM_THM_JUMP19 against symbol
> `cpu_resume' defined in .data section in arch/arm/kernel/built-in.o
>
> This patch using a Thumb2 instruction IT (if-then) to have a longer branch
> range.
>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Joseph Lo <josephl@nvidia.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Applied to fixes-non-critical.
-Olof
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-04-18 16:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-15 12:42 [PATCH 1/3] ARM: tegra: fix build error when THUMB2_KERNEL enabled Joseph Lo
2013-04-15 12:42 ` [PATCH 2/3] ARM: tegra: fix relocation truncated " Joseph Lo
2013-04-15 12:42 ` [PATCH 3/3] ARM: tegra: make sure the pointer on 4 byte align " Joseph Lo
2013-04-15 22:51 ` [PATCH 1/3] ARM: tegra: fix build error " Stephen Warren
-- strict thread matches above, loose matches on Subject: below --
2013-04-15 22:50 Stephen Warren
2013-04-15 22:50 ` [PATCH 2/3] ARM: tegra: fix relocation truncated " Stephen Warren
2013-04-17 17:01 ` Dave Martin
2013-04-18 16:32 ` Olof Johansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).