From: Stephen Boyd <sboyd@codeaurora.org>
To: Russell King <linux@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Kevin Hilman <khilman@linaro.org>,
Andy Gross <agross@codeaurora.org>,
Kumar Gala <galak@codeaurora.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Lina Iyer <lina.iyer@linaro.org>
Subject: [PATCH v2 1/2] ARM: Add cpu_resume_arm() for firmwares that resume in ARM state
Date: Tue, 2 Jun 2015 12:12:57 -0700 [thread overview]
Message-ID: <1433272378-8470-2-git-send-email-sboyd@codeaurora.org> (raw)
In-Reply-To: <1433272378-8470-1-git-send-email-sboyd@codeaurora.org>
Some platforms always enter the kernel in the ARM state even if
the kernel is compiled for THUMB2. Add a small wrapper on top of
cpu_resume() that switches into THUMB2 state.
This fixes a problem reported by Kevin Hilman on next-20150601
where the ifc6410 fails to boot a THUMB2 kernel because the
platform's firmware always enters the kernel in ARM mode from
deep idle states.
Reported-by: Kevin Hilman <khilman@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Lina Iyer <lina.iyer@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
arch/arm/include/asm/suspend.h | 1 +
arch/arm/kernel/sleep.S | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h
index cd20029bcd94..6c7182f32cef 100644
--- a/arch/arm/include/asm/suspend.h
+++ b/arch/arm/include/asm/suspend.h
@@ -7,6 +7,7 @@ struct sleep_save_sp {
};
extern void cpu_resume(void);
+extern void cpu_resume_arm(void);
extern int cpu_suspend(unsigned long, int (*)(unsigned long));
#endif
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 76bb3128e135..f37593567ef5 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -118,6 +118,12 @@ ENDPROC(cpu_resume_after_mmu)
.text
.align
+ .arm
+ENTRY(cpu_resume_arm)
+ THUMB( badr r9, 1f ) @ Kernel is entered in ARM.
+ THUMB( bx r9 ) @ If this is a Thumb-2 kernel,
+ THUMB( .thumb ) @ switch to Thumb now.
+ THUMB(1: )
ENTRY(cpu_resume)
ARM_BE8(setend be) @ ensure we are in BE mode
#ifdef CONFIG_ARM_VIRT_EXT
@@ -149,6 +155,7 @@ THUMB( ldmia r0!, {r1, r2, r3} )
THUMB( mov sp, r2 )
THUMB( bx r3 )
ENDPROC(cpu_resume)
+ENDPROC(cpu_resume_arm)
.align 2
_sleep_save_sp:
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] ARM: Add cpu_resume_arm() for firmwares that resume in ARM state
Date: Tue, 2 Jun 2015 12:12:57 -0700 [thread overview]
Message-ID: <1433272378-8470-2-git-send-email-sboyd@codeaurora.org> (raw)
In-Reply-To: <1433272378-8470-1-git-send-email-sboyd@codeaurora.org>
Some platforms always enter the kernel in the ARM state even if
the kernel is compiled for THUMB2. Add a small wrapper on top of
cpu_resume() that switches into THUMB2 state.
This fixes a problem reported by Kevin Hilman on next-20150601
where the ifc6410 fails to boot a THUMB2 kernel because the
platform's firmware always enters the kernel in ARM mode from
deep idle states.
Reported-by: Kevin Hilman <khilman@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Lina Iyer <lina.iyer@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
arch/arm/include/asm/suspend.h | 1 +
arch/arm/kernel/sleep.S | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h
index cd20029bcd94..6c7182f32cef 100644
--- a/arch/arm/include/asm/suspend.h
+++ b/arch/arm/include/asm/suspend.h
@@ -7,6 +7,7 @@ struct sleep_save_sp {
};
extern void cpu_resume(void);
+extern void cpu_resume_arm(void);
extern int cpu_suspend(unsigned long, int (*)(unsigned long));
#endif
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 76bb3128e135..f37593567ef5 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -118,6 +118,12 @@ ENDPROC(cpu_resume_after_mmu)
.text
.align
+ .arm
+ENTRY(cpu_resume_arm)
+ THUMB( badr r9, 1f ) @ Kernel is entered in ARM.
+ THUMB( bx r9 ) @ If this is a Thumb-2 kernel,
+ THUMB( .thumb ) @ switch to Thumb now.
+ THUMB(1: )
ENTRY(cpu_resume)
ARM_BE8(setend be) @ ensure we are in BE mode
#ifdef CONFIG_ARM_VIRT_EXT
@@ -149,6 +155,7 @@ THUMB( ldmia r0!, {r1, r2, r3} )
THUMB( mov sp, r2 )
THUMB( bx r3 )
ENDPROC(cpu_resume)
+ENDPROC(cpu_resume_arm)
.align 2
_sleep_save_sp:
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-06-02 19:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 19:12 [PATCH v2 0/2] Fix cpuidle on qcom's THUMB2 kernels Stephen Boyd
2015-06-02 19:12 ` Stephen Boyd
2015-06-02 19:12 ` Stephen Boyd [this message]
2015-06-02 19:12 ` [PATCH v2 1/2] ARM: Add cpu_resume_arm() for firmwares that resume in ARM state Stephen Boyd
2015-06-02 23:40 ` Russell King - ARM Linux
2015-06-02 23:40 ` Russell King - ARM Linux
2015-06-03 0:11 ` Stephen Boyd
2015-06-03 0:11 ` Stephen Boyd
2015-06-08 21:33 ` Kevin Hilman
2015-06-08 21:33 ` Kevin Hilman
2015-06-08 21:38 ` Stephen Boyd
2015-06-08 21:38 ` Stephen Boyd
2015-06-08 22:03 ` Kevin Hilman
2015-06-08 22:03 ` Kevin Hilman
2015-06-09 15:29 ` Russell King - ARM Linux
2015-06-09 15:29 ` Russell King - ARM Linux
2015-06-09 18:32 ` Stephen Boyd
2015-06-09 18:32 ` Stephen Boyd
2015-06-15 6:33 ` Uwe Kleine-König
2015-06-15 6:33 ` Uwe Kleine-König
2015-06-15 11:01 ` Russell King - ARM Linux
2015-06-15 11:01 ` Russell King - ARM Linux
2015-06-15 13:38 ` Uwe Kleine-König
2015-06-15 13:38 ` Uwe Kleine-König
2015-06-02 19:12 ` [PATCH v2 2/2] soc: qcom: spm: Fix idle on THUMB2 kernels Stephen Boyd
2015-06-02 19:12 ` Stephen Boyd
2015-06-04 16:15 ` Lina Iyer
2015-06-04 16:15 ` Lina Iyer
2015-06-02 21:23 ` [PATCH v2 0/2] Fix cpuidle on qcom's " Kevin Hilman
2015-06-02 21:23 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433272378-8470-2-git-send-email-sboyd@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=agross@codeaurora.org \
--cc=ard.biesheuvel@linaro.org \
--cc=galak@codeaurora.org \
--cc=khilman@linaro.org \
--cc=lina.iyer@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.