linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <acourbot@nvidia.com>
To: Stephen Warren <swarren@wwwdotorg.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Russell King <linux@arm.linux.org.uk>
Cc: Olof Johansson <olof@lixom.net>,
	linux-arm-kernel@lists.infradead.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	gnurou@gmail.com, Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH 2/5] ARM: trusted_foundations: fallback when TF support is missing
Date: Tue, 21 Jan 2014 19:10:13 +0900	[thread overview]
Message-ID: <1390299016-14105-3-git-send-email-acourbot@nvidia.com> (raw)
In-Reply-To: <1390299016-14105-1-git-send-email-acourbot@nvidia.com>

When Trusted Foundations is detected as present on the system, but
Trusted Foundations support is not built into the kernel, the kernel
used to issue a panic very early during boot, leaving little clue to the
user as to what is going wrong.

It turns out that even without TF support built-in, the kernel can boot
on a TF-enabled system provided that SMP and cpuidle are disabled. This
patch does this and continue booting on one CPU, leaving the user with a
usable (however degraded) system.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 arch/arm/include/asm/trusted_foundations.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/trusted_foundations.h b/arch/arm/include/asm/trusted_foundations.h
index 997862fd5d77..b5f7705abcb0 100644
--- a/arch/arm/include/asm/trusted_foundations.h
+++ b/arch/arm/include/asm/trusted_foundations.h
@@ -30,6 +30,8 @@
 #include <linux/printk.h>
 #include <linux/bug.h>
 #include <linux/of.h>
+#include <linux/cpu.h>
+#include <linux/smp.h>
 
 struct trusted_foundations_platform_data {
 	unsigned int version_major;
@@ -47,10 +49,13 @@ static inline void register_trusted_foundations(
 				   struct trusted_foundations_platform_data *pd)
 {
 	/*
-	 * If we try to register TF, this means the system needs it to continue.
-	 * Its absence if thus a fatal error.
+	 * If the system requires TF and we cannot provide it, continue booting
+	 * but disable features that cannot be provided.
 	 */
-	panic("No support for Trusted Foundations, stopping...\n");
+	pr_err("No support for Trusted Foundations, continuing in degraded mode.\n");
+	pr_err("Secondary processors as well as CPU PM will be disabled.\n");
+	setup_max_cpus = 0;
+	cpu_idle_poll_ctrl(true);
 }
 
 static inline void of_register_trusted_foundations(void)
-- 
1.8.5.3

  parent reply	other threads:[~2014-01-21 10:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 10:10 [PATCH 0/5] ARM: firmware: improvements to Trusted Foundations support Alexandre Courbot
2014-01-21 10:10 ` [PATCH 1/5] ARM: trusted_foundations: fix vendor prefix typos Alexandre Courbot
2014-01-21 10:10 ` Alexandre Courbot [this message]
2014-01-21 10:10 ` [PATCH 4/5] ARM: trusted_foundations: implement do_idle() Alexandre Courbot
     [not found]   ` <1390299016-14105-5-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-01-22 20:43     ` Stephen Warren
     [not found]       ` <52E02D8C.7090309-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-01-23  7:39         ` Alexandre Courbot
2014-01-21 10:10 ` [PATCH 5/5] ARM: tegra: cpuidle: use firmware call for power down Alexandre Courbot
     [not found]   ` <1390299016-14105-6-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-01-22 20:45     ` Stephen Warren
2014-01-23  7:39       ` Alexandre Courbot
     [not found]         ` <CAAVeFuKLtC62+bujY4724hMV_6M8Ow0s=6zRn_M87VX4PHQgxA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-05 16:28           ` Stephen Warren
2014-02-06  2:28             ` Alexandre Courbot
     [not found] ` <1390299016-14105-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-01-21 10:10   ` [PATCH 3/5] ARM: firmware: enable Trusted Foundations by default Alexandre Courbot
     [not found]     ` <1390299016-14105-4-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-01-22 20:42       ` Stephen Warren
2014-01-23  7:38         ` Alexandre Courbot
2014-01-22 20:47   ` [PATCH 0/5] ARM: firmware: improvements to Trusted Foundations support Stephen Warren

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=1390299016-14105-3-git-send-email-acourbot@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=gnurou@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.com \
    /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).