From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] Make SMP secondary CPU up more resilient to failure.
Date: Sat, 18 Dec 2010 00:36:10 +0000 [thread overview]
Message-ID: <20101218003610.GH9937@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20101218000828.GG9937@n2100.arm.linux.org.uk>
On Sat, Dec 18, 2010 at 12:08:28AM +0000, Russell King - ARM Linux wrote:
> The first bug I've spotted in that area would be VFP - which is not
> hotplug aware. VFP needs to register into the hotplug notifier system
> so that vfp_enable() can be called. I'll have a patch for that before
> this weekend is out.
This patch ensures that VFP is correctly re-initialized when the CPU
restarts.
arch/arm/vfp/vfpmodule.c | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 8063a32..b865a53 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -10,9 +10,12 @@
*/
#include <linux/module.h>
#include <linux/types.h>
+#include <linux/cpu.h>
#include <linux/kernel.h>
+#include <linux/notifier.h>
#include <linux/signal.h>
#include <linux/sched.h>
+#include <linux/smp.h>
#include <linux/init.h>
#include <asm/cputype.h>
@@ -484,7 +487,19 @@ void vfp_flush_hwstate(struct thread_info *thread)
put_cpu();
}
-#include <linux/smp.h>
+#ifdef CONFIG_HOTPLUG_CPU
+static int vfp_hotplug_notifier(struct notifier_block *b, unsigned long action,
+ void *data)
+{
+ if (action == CPU_STARTING)
+ vfp_enable(NULL);
+ return NOTIFY_OK;
+}
+
+static struct notifier_block vfp_hotplug_nb = {
+ .notifier_call = vfp_hotplug_notifier,
+};
+#endif
/*
* VFP support code initialisation.
@@ -514,6 +529,10 @@ static int __init vfp_init(void)
else if (vfpsid & FPSID_NODOUBLE) {
printk("no double precision support\n");
} else {
+#ifdef CONFIG_HOTPLUG_CPU
+ register_cpu_notifier(&vfp_hotplug_nb);
+#endif
+
smp_call_function(vfp_enable, NULL, 1);
VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */
next prev parent reply other threads:[~2010-12-18 0:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 23:45 [RFC] Make SMP secondary CPU up more resilient to failure Andrei Warkentin
2010-12-16 11:34 ` Russell King - ARM Linux
2010-12-16 23:09 ` Andrei Warkentin
2010-12-16 23:28 ` Russell King - ARM Linux
2010-12-17 20:52 ` Andrei Warkentin
2010-12-17 23:14 ` Russell King - ARM Linux
2010-12-17 23:45 ` Andrei Warkentin
2010-12-18 0:08 ` Russell King - ARM Linux
2010-12-18 0:36 ` Russell King - ARM Linux [this message]
2010-12-18 7:17 ` Andrei Warkentin
2010-12-18 12:01 ` Russell King - ARM Linux
2010-12-18 12:10 ` Andrei Warkentin
2010-12-18 20:04 ` Russell King - ARM Linux
2010-12-21 21:53 ` Andrei Warkentin
2010-12-24 17:38 ` Russell King - ARM Linux
2011-01-13 10:19 ` Andrei Warkentin
2011-01-13 11:14 ` Russell King - ARM Linux
2011-01-13 22:03 ` Andrei Warkentin
2010-12-17 0:11 ` murali at embeddedwireless.com
2010-12-18 9:58 ` Russell King - ARM Linux
2010-12-18 11:54 ` Andrei Warkentin
2010-12-18 12:19 ` Russell King - ARM Linux
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=20101218003610.GH9937@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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).