From: keita kobayashi <keita.kobayashi.ym@renesas.com>
To: linux-sh@vger.kernel.org, linux-pm@vger.kernel.org
Cc: horms+renesas@verge.net.au, Magnus Damm <magnus.damm@gmail.com>,
rjw@rjwysocki.net
Subject: [PATCH 5/6] ARM: shmobile: Add CPU notifier for CPUIdle boot vector
Date: Fri, 1 Aug 2014 18:48:52 +0900 [thread overview]
Message-ID: <53DB6284.3090506@renesas.com> (raw)
Add CPU notifiers for the shared mach-shmobile cpuidle code.
Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
---
arch/arm/mach-shmobile/cpuidle.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c
index 19c0c98..1771dd3 100644
--- a/arch/arm/mach-shmobile/cpuidle.c
+++ b/arch/arm/mach-shmobile/cpuidle.c
@@ -20,6 +20,27 @@
#include <asm/io.h>
#include "common.h"
+static int shmobile_cpuidle_notifier_call(struct notifier_block *nfb,
+ unsigned long action, void *hcpu)
+{
+ unsigned int cpu = (long)hcpu;
+
+ switch (action) {
+ case CPU_ONLINE:
+ case CPU_STARTING:
+ case CPU_STARTING_FROZEN:
+ /* For this particular CPU register CPUIdle boot vector */
+ shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0);
+ break;
+ };
+
+ return NOTIFY_OK;
+}
+
+static struct notifier_block shmobile_cpuidle_notifier = {
+ .notifier_call = shmobile_cpuidle_notifier_call,
+};
+
static struct cpuidle_driver shmobile_cpuidle_default_driver = {
.name = "shmobile_cpuidle",
.owner = THIS_MODULE,
@@ -51,6 +72,9 @@ int __init shmobile_cpuidle_init(void)
}
#ifdef CONFIG_ARCH_SHMOBILE_MULTI
+ /* Use CPU notifier for reset vector control */
+ register_cpu_notifier(&shmobile_cpuidle_notifier);
+
platform_device_register(&shmobile_cpuidle);
return 0;
#else
--
1.7.9.5
WARNING: multiple messages have this Message-ID (diff)
From: keita kobayashi <keita.kobayashi.ym@renesas.com>
To: linux-sh@vger.kernel.org, linux-pm@vger.kernel.org
Cc: horms+renesas@verge.net.au, Magnus Damm <magnus.damm@gmail.com>,
rjw@rjwysocki.net
Subject: [PATCH 5/6] ARM: shmobile: Add CPU notifier for CPUIdle boot vector
Date: Fri, 01 Aug 2014 09:48:52 +0000 [thread overview]
Message-ID: <53DB6284.3090506@renesas.com> (raw)
Add CPU notifiers for the shared mach-shmobile cpuidle code.
Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
---
arch/arm/mach-shmobile/cpuidle.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c
index 19c0c98..1771dd3 100644
--- a/arch/arm/mach-shmobile/cpuidle.c
+++ b/arch/arm/mach-shmobile/cpuidle.c
@@ -20,6 +20,27 @@
#include <asm/io.h>
#include "common.h"
+static int shmobile_cpuidle_notifier_call(struct notifier_block *nfb,
+ unsigned long action, void *hcpu)
+{
+ unsigned int cpu = (long)hcpu;
+
+ switch (action) {
+ case CPU_ONLINE:
+ case CPU_STARTING:
+ case CPU_STARTING_FROZEN:
+ /* For this particular CPU register CPUIdle boot vector */
+ shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0);
+ break;
+ };
+
+ return NOTIFY_OK;
+}
+
+static struct notifier_block shmobile_cpuidle_notifier = {
+ .notifier_call = shmobile_cpuidle_notifier_call,
+};
+
static struct cpuidle_driver shmobile_cpuidle_default_driver = {
.name = "shmobile_cpuidle",
.owner = THIS_MODULE,
@@ -51,6 +72,9 @@ int __init shmobile_cpuidle_init(void)
}
#ifdef CONFIG_ARCH_SHMOBILE_MULTI
+ /* Use CPU notifier for reset vector control */
+ register_cpu_notifier(&shmobile_cpuidle_notifier);
+
platform_device_register(&shmobile_cpuidle);
return 0;
#else
--
1.7.9.5
next reply other threads:[~2014-08-01 9:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 9:48 keita kobayashi [this message]
2014-08-01 9:48 ` [PATCH 5/6] ARM: shmobile: Add CPU notifier for CPUIdle boot vector keita kobayashi
2014-08-22 10:48 ` Magnus Damm
2014-08-22 10:48 ` Magnus Damm
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=53DB6284.3090506@renesas.com \
--to=keita.kobayashi.ym@renesas.com \
--cc=horms+renesas@verge.net.au \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=rjw@rjwysocki.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.