From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH 01/02] ARM: shmobile: Extend SCU CPU notifier to handle CPUIdle
Date: Sat, 14 Sep 2013 14:15:34 +0000 [thread overview]
Message-ID: <20130914141534.19348.12232.sendpatchset@w520> (raw)
From: Magnus Damm <damm@opensource.se>
Register CPUIdle boot vector via CPU notifiers in the
mach-shmobile SCU SMP code.
Not-Yet-Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/platsmp-scu.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
--- 0008/arch/arm/mach-shmobile/platsmp-scu.c
+++ work/arch/arm/mach-shmobile/platsmp-scu.c 2013-09-14 22:21:14.000000000 +0900
@@ -22,12 +22,27 @@ static int shmobile_smp_scu_notifier_cal
{
unsigned int cpu = (long)hcpu;
+ /* During SMP boot and for CPU Hotplug, use CPU_UP_PREPARE
+ * to register boot vector. Runtime CPU power management
+ * via a separate CPUIdle driver requires a different boot
+ * vector which is installed at CPU_ONLINE time.
+ */
+
switch (action) {
case CPU_UP_PREPARE:
/* For this particular CPU register SCU SMP boot vector */
shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
(unsigned long)shmobile_scu_base);
break;
+ case CPU_UP_CANCELED:
+ case CPU_POST_DEAD:
+ /* Unregister boot vector */
+ shmobile_smp_hook(cpu, 0, 0);
+ break;
+ case CPU_ONLINE:
+ /* Register CPUIdle boot vector */
+ shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0);
+ break;
};
return NOTIFY_OK;
@@ -49,14 +64,14 @@ void __init shmobile_smp_scu_prepare_cpu
/* Use CPU notifier for reset vector control */
register_cpu_notifier(&shmobile_smp_scu_notifier);
+
+ /* Make sure boot CPU also gets CPUIdle initialized */
+ shmobile_smp_scu_notifier_call(NULL, CPU_ONLINE, 0);
}
#ifdef CONFIG_HOTPLUG_CPU
void shmobile_smp_scu_cpu_die(unsigned int cpu)
{
- /* For this particular CPU deregister boot vector */
- shmobile_smp_hook(cpu, 0, 0);
-
dsb();
flush_cache_all();
reply other threads:[~2013-09-14 14:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20130914141534.19348.12232.sendpatchset@w520 \
--to=magnus.damm@gmail.com \
--cc=linux-sh@vger.kernel.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).