linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Lina Iyer <lina.iyer@linaro.org>
Subject: Re: [PATCH] ARM: Enter CPU in ARM state for cpu_resume
Date: Mon, 1 Jun 2015 22:45:25 +0100	[thread overview]
Message-ID: <20150601214525.GT2067@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1433190120-27798-1-git-send-email-sboyd@codeaurora.org>

On Mon, Jun 01, 2015 at 01:22:00PM -0700, Stephen Boyd wrote:
> The standard boot protocol on ARM requires CPUs to be entered in
> the ARM state, unless they don't support the ARM instruction set
> (see Documentation/arm/Booting). On THUMB2 kernels, we assume
> the firmware can determine what state to enter the kernel in, but
> some firmwares don't honor the thumb bit. Make the cpu_resume
> symbol an ARM symbol, so that firmwares that honor the thumb bit
> will enter the kernel in ARM state and firmwares that don't honor
> the thumb bit will be able to enter the kernel in ARM state
> without more changes.
> 
> This fixes a problem reported by Kevin Hilman where the ifc6410 
> fails to boot for THUMB2 kernels because the platform's firmware
> always enters the kernel in ARM mode from deep idle states.

Please do this differently.  The default should be (as we do with
the SMP secondary entry path) to assume that the firmware does the
right thing.

So, if we want an ARM-mode entry point, please use:

+		.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:			)

Don't forget an ENDPROC() for the new symbol.  Buggy platforms then
use cpu_resume_arm instead of cpu_resume.

Thanks.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2015-06-01 21:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 20:22 [PATCH] ARM: Enter CPU in ARM state for cpu_resume Stephen Boyd
2015-06-01 21:45 ` Russell King - ARM Linux [this message]
2015-06-02  6:18   ` Ard Biesheuvel
2015-06-02  8:34     ` Russell King - ARM Linux
2015-06-02 10:34       ` Ard Biesheuvel

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=20150601214525.GT2067@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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=sboyd@codeaurora.org \
    /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 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).