From: Michael Ellerman <michael@ellerman.id.au>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH 4/5] Only enable cpu hotplug via RTAS if the required firmware support is found
Date: Tue, 05 Dec 2006 17:52:38 +1100 [thread overview]
Message-ID: <20061205065236.A77FA67BC1@ozlabs.org> (raw)
In-Reply-To: <1165301556.843426.760217571714.qpush@cradle>
To support cpu hotplug on pseries we require two RTAS tokens, the cpu
hotplug machinery should only be wired up if these tokens are found in
the device tree.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/hotplug-cpu.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
Index: powerpc/arch/powerpc/platforms/pseries/hotplug-cpu.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ powerpc/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -64,6 +64,8 @@ static void pSeries_mach_cpu_die(void)
for(;;);
}
+static int qcss_tok; /* query-cpu-stopped-state token */
+
/* Get state of physical CPU.
* Return codes:
* 0 - The processor is in the RTAS stopped state
@@ -74,12 +76,8 @@ static void pSeries_mach_cpu_die(void)
*/
static int query_cpu_stopped(unsigned int pcpu)
{
- int cpu_status;
- int status, qcss_tok;
+ int cpu_status, status;
- qcss_tok = rtas_token("query-cpu-stopped-state");
- if (qcss_tok == RTAS_UNKNOWN_SERVICE)
- return -1;
status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
if (status != 0) {
printk(KERN_ERR
@@ -254,9 +252,16 @@ static struct notifier_block pSeries_smp
static int __init pseries_cpu_hotplug_init(void)
{
rtas_stop_self_args.token = rtas_token("stop-self");
+ qcss_tok = rtas_token("query-cpu-stopped-state");
- ppc_md.cpu_die = pSeries_mach_cpu_die;
+ if (rtas_stop_self_args.token == RTAS_UNKNOWN_SERVICE ||
+ qcss_tok == RTAS_UNKNOWN_SERVICE) {
+ printk(KERN_INFO "CPU Hotplug not supported by firmware "
+ "- disabling.\n");
+ return 0;
+ }
+ ppc_md.cpu_die = pSeries_mach_cpu_die;
smp_ops->cpu_disable = pSeries_cpu_disable;
smp_ops->cpu_die = pSeries_cpu_die;
next prev parent reply other threads:[~2006-12-05 6:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-05 6:52 [PATCH 1/5] Move rtas_stop_self() into platforms/pseries/hotplug-cpu.c Michael Ellerman
2006-12-05 6:52 ` [PATCH 2/5] Move pSeries_mach_cpu_die() " Michael Ellerman
2006-12-05 6:52 ` Michael Ellerman [this message]
2006-12-05 6:52 ` [PATCH 3/5] Move the rest of the hotplug cpu code " Michael Ellerman
2006-12-05 6:52 ` [PATCH 5/5] Cleanup pass over platforms/pseries/hotplug-cpu.c Michael Ellerman
2006-12-06 22:51 ` [PATCH 1/5] Move rtas_stop_self() into platforms/pseries/hotplug-cpu.c Linas Vepstas
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=20061205065236.A77FA67BC1@ozlabs.org \
--to=michael@ellerman.id.au \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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).