aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-11-29 15:36:49 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-03 21:49:12 -0600
commit674be30c94374eadd050fb8782d371e791006a08 (patch)
tree6246cbcf02c531f1c7c59e05ee6238ef6ed98ba9
parent3598f41970f245e5d880709b7ae86967a189601e (diff)
downloadskiboot-674be30c94374eadd050fb8782d371e791006a08.zip
skiboot-674be30c94374eadd050fb8782d371e791006a08.tar.gz
skiboot-674be30c94374eadd050fb8782d371e791006a08.tar.bz2
fast-reboot: inline fast_reset_p8 into fast_reboot
This function has shrunk to the point it's not so helpful to keep it, it's no longer power8 specific, and getting rid of it simplifies error handling a little in future changes. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/fast-reboot.c54
1 files changed, 24 insertions, 30 deletions
diff --git a/core/fast-reboot.c b/core/fast-reboot.c
index 47b72d5..679e1ca 100644
--- a/core/fast-reboot.c
+++ b/core/fast-reboot.c
@@ -316,32 +316,6 @@ static int sreset_all_others(void)
return OPAL_UNSUPPORTED;
}
-static bool fast_reset_p8(void)
-{
- struct cpu_thread *cpu;
-
- if (sreset_all_prepare())
- return false;
-
- /* Put everybody in stop except myself */
- for_each_ungarded_cpu(cpu) {
- /* Also make sure that saved_r1 is 0 ! That's what will
- * make our reset vector jump to fast_reboot_entry
- */
- cpu->save_r1 = 0;
- }
-
- /* Restore skiboot vectors */
- copy_exception_vectors();
- setup_reset_vector();
-
- /* Send everyone else to 0x100 */
- if (sreset_all_others() == OPAL_SUCCESS)
- return true;
-
- return false;
-}
-
static bool cpu_state_wait_all_others(enum cpu_thread_state state,
unsigned long timeout_tb)
{
@@ -386,7 +360,7 @@ void disable_fast_reboot(const char *reason)
void fast_reboot(void)
{
- bool success;
+ struct cpu_thread *cpu;
static int fast_reboot_count = 0;
if (proc_gen != proc_gen_p8) {
@@ -428,12 +402,32 @@ void fast_reboot(void)
fast_boot_release = false;
sync();
- success = fast_reset_p8();
+ /* Put everybody in stop except myself */
+ if (sreset_all_prepare())
+ return;
- /* Unlock, at this point we go away */
+ /* Now everyone else is stopped */
unlock(&reset_lock);
- if (!success)
+ /*
+ * There is no point clearing special wakeup due to failure after this
+ * point, because we will be going to full IPL. Less cleanup work means
+ * less opportunity to fail.
+ */
+
+ for_each_ungarded_cpu(cpu) {
+ /* Also make sure that saved_r1 is 0 ! That's what will
+ * make our reset vector jump to fast_reboot_entry
+ */
+ cpu->save_r1 = 0;
+ }
+
+ /* Restore skiboot vectors */
+ copy_exception_vectors();
+ setup_reset_vector();
+
+ /* Send everyone else to 0x100 */
+ if (sreset_all_others() != OPAL_SUCCESS)
return;
/* Ensure all the sresets get through */