From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ARM: vexpress: add support for CPU hotplug to ct-ca9x4 tile
Date: Wed, 8 Sep 2010 17:46:02 +0100 [thread overview]
Message-ID: <000301cb4f75$52e66570$f8b33050$@deacon@arm.com> (raw)
In-Reply-To: <20100908143700.GB32659@n2100.arm.linux.org.uk>
Hi Russell,
> On Tue, Aug 17, 2010 at 04:58:04PM +0100, Will Deacon wrote:
> > The Versatile Express platform can support a quad-core Cortex-A9 tile running
> > SMP Linux.
> >
> > This patch adds support for CPU hotplug when running in this configuration.
>
> This ties the core tile support into the generic versatile express code,
> something which the current code structure is careful to avoid. Please
> ensure that we continue to avoid making the generic code rely upon
> CA9x4 code.
The cpu_{enter,leave}_lowpower functions are implemented in the tile code
so they should be ok. I suppose the problem is that we might be able to do
better than a WFI on some tiles. How about this?:
diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c
new file mode 100644
index 0000000..672e434
--- /dev/null
+++ b/arch/arm/mach-vexpress/hotplug.c
@@ -0,0 +1,47 @@
+/*
+ * linux/arch/arm/mach-vexpress/hotplug.c
+ *
+ * Copyright (C) 2010 ARM Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/smp.h>
+#include <linux/completion.h>
+
+#include <plat/hotplug.h>
+
+extern volatile int pen_release;
+
+/* CPU-specific functions implemented in the tile support code */
+extern void cpu_enter_lowpower(void);
+extern int cpu_do_lowpower(void);
+extern void cpu_leave_lowpower(void);
+
+void __ref platform_do_lowpower(unsigned int cpu)
+{
+ cpu_enter_lowpower();
+
+ if (cpu_do_lowpower() == -ENODEV) {
+ /*
+ * Tile does not have any low-power hardware so we
+ * put the core into a WFI.
+ */
+ for (;;) {
+ asm volatile("wfi" : : : "memory");
+
+ if (pen_release == cpu)
+ break;
+
+#ifdef DEBUG
+ printk("CPU%u: spurious wakeup call\n", cpu);
+#endif
+ }
+ }
+
+ cpu_leave_lowpower();
+}
The alternative would be to merge all the cpu_* functions into one, but
then we'd end up replicating the wfi code across all the tiles without
additional power-saving hardware.
Cheers,
Will
next prev parent reply other threads:[~2010-09-08 16:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 15:58 [PATCH 0/3] CPU hotplug support for Versatile platforms Will Deacon
2010-08-17 15:58 ` [PATCH 1/3] ARM: realview: fix CPU hotplug support for SMP platforms Will Deacon
2010-08-17 15:58 ` [PATCH 2/3] ARM: plat-versatile: factor out common hotplug code Will Deacon
2010-08-17 15:58 ` [PATCH 3/3] ARM: vexpress: add support for CPU hotplug to ct-ca9x4 tile Will Deacon
2010-09-08 14:37 ` Russell King - ARM Linux
2010-09-08 16:46 ` Will Deacon [this message]
2010-09-08 16:51 ` 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='000301cb4f75$52e66570$f8b33050$@deacon@arm.com' \
--to=will.deacon@arm.com \
--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