From: Dave.Martin@arm.com (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/3] ARM: mcpm: Factor out logical-to-physical CPU translation
Date: Mon, 30 Sep 2013 16:06:45 +0100 [thread overview]
Message-ID: <1380553607-3271-2-git-send-email-Dave.Martin@arm.com> (raw)
In-Reply-To: <1380553607-3271-1-git-send-email-Dave.Martin@arm.com>
This patch factors the logical-to-physical CPU translation out of
mcpm_boot_secondary(), so that it can be reused elsewhere.
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---
arch/arm/common/mcpm_platsmp.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/arch/arm/common/mcpm_platsmp.c b/arch/arm/common/mcpm_platsmp.c
index 1bc34c7..c0c3cd7 100644
--- a/arch/arm/common/mcpm_platsmp.c
+++ b/arch/arm/common/mcpm_platsmp.c
@@ -19,14 +19,23 @@
#include <asm/smp.h>
#include <asm/smp_plat.h>
+static void cpu_to_pcpu(unsigned int cpu,
+ unsigned int *pcpu, unsigned int *pcluster)
+{
+ unsigned int mpidr;
+
+ mpidr = cpu_logical_map(cpu);
+ *pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+ *pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+}
+
static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
- unsigned int mpidr, pcpu, pcluster, ret;
+ unsigned int pcpu, pcluster, ret;
extern void secondary_startup(void);
- mpidr = cpu_logical_map(cpu);
- pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
- pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+ cpu_to_pcpu(cpu, &pcpu, &pcluster);
+
pr_debug("%s: logical CPU %d is physical CPU %d cluster %d\n",
__func__, cpu, pcpu, pcluster);
--
1.7.9.5
next prev parent reply other threads:[~2013-09-30 15:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-30 15:06 [RFC PATCH 0/3] MCPM/TC2 support for CPU powerdown synchronisation Dave Martin
2013-09-30 15:06 ` Dave Martin [this message]
2013-09-30 16:51 ` [RFC PATCH 1/3] ARM: mcpm: Factor out logical-to-physical CPU translation Nicolas Pitre
2013-09-30 15:06 ` [RFC PATCH 2/3] ARM: mcpm: Implement cpu_kill() to synchronise on powerdown Dave Martin
2013-09-30 17:00 ` Nicolas Pitre
2013-09-30 17:20 ` Dave Martin
2013-09-30 17:32 ` Nicolas Pitre
2013-09-30 15:06 ` [RFC PATCH 3/3] ARM: vexpress/TC2: Implement MCPM power_down_finish() Dave Martin
2013-09-30 17:14 ` Nicolas Pitre
2013-09-30 17:26 ` Dave Martin
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=1380553607-3271-2-git-send-email-Dave.Martin@arm.com \
--to=dave.martin@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 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.