From: linas@austin.ibm.com (Linas Vepstas)
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, strosake@us.ibm.com
Subject: [PATCH] powerpc/pseries: tell phyp to auto-restart
Date: Tue, 20 Nov 2007 20:09:22 -0600 [thread overview]
Message-ID: <20071121020922.GA4374@austin.ibm.com> (raw)
The pseries hypervisor attempts to detect and prevent an
infinite loop of kernel crashes and auto-reboots. It does
so by refusing to auto-reboot unless we indicate that the
current boot was sucessful. So, indicate success late in
the boot sequence.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
----
Sigh. This is a side-effect of the patch I sent yesterday.
Its supposed to simplify the management large numbers of
partitions.
arch/powerpc/platforms/pseries/setup.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
Index: linux-2.6.24-rc3-git1/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- linux-2.6.24-rc3-git1.orig/arch/powerpc/platforms/pseries/setup.c 2007-11-20 18:37:14.000000000 -0600
+++ linux-2.6.24-rc3-git1/arch/powerpc/platforms/pseries/setup.c 2007-11-20 19:08:12.000000000 -0600
@@ -491,6 +491,37 @@ void pSeries_power_off(void)
for (;;);
}
+/**
+ * pSeries_auto_restart - tell hypervisor that boot succeeded.
+ *
+ * The pseries hypervisor attempts to detect and prevent an
+ * infinite loop of kernel crashes and auto-reboots. It does
+ * so by refusing to auto-reboot unless we indicate that the
+ * current boot was sucessful. So, indicate success late in
+ * the boot sequence.
+ */
+static int __init pSeries_auto_restart(void)
+{
+ static char buff[3]; /* static so that its in RMO region */
+ int rc;
+ int token = rtas_token("ibm,set-system-parameter");
+ if (!token)
+ return 0;
+
+ /* partition_auto_restart is 21; set to to 1 to auto-restart the OS. */
+ buff[0] = 0;
+ buff[1] = 1; /* length */
+ buff[2] = 1; /* value */
+ do {
+ rc = rtas_call (token, 2, 1, NULL, 21, buff);
+ } while (rtas_busy_delay(rc));
+ if (rc)
+ printk(KERN_INFO "pSeries_auto_restart(): "
+ "unable to setup autorestart, rc=%d\n", rc);
+ return 0;
+}
+late_initcall(pSeries_auto_restart);
+
#ifndef CONFIG_PCI
void pSeries_final_fixup(void) { }
#endif
reply other threads:[~2007-11-21 2:09 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=20071121020922.GA4374@austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=strosake@us.ibm.com \
/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).