diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-10-24 17:28:29 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-10-25 19:31:03 +1100 |
commit | d3caa64c4ed364af1be1471ad3d67a6f310552d1 (patch) | |
tree | 8ffd1beb34ca8409b88c83b317b82ac8a7210a1b | |
parent | e16101408667e23d6d841003bbf07cd345d9d034 (diff) | |
download | skiboot-d3caa64c4ed364af1be1471ad3d67a6f310552d1.zip skiboot-d3caa64c4ed364af1be1471ad3d67a6f310552d1.tar.gz skiboot-d3caa64c4ed364af1be1471ad3d67a6f310552d1.tar.bz2 |
fast-reboot: disable on FSP code update or unrecoverable HMI
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
[stewart@linux.vnet.ibm.com: unlock before return (suggested by Mahesh/Andrew),
disable only on non-cancelling fsp codeupdate call (suggested by Vasant)]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/fast-reboot.c | 19 | ||||
-rw-r--r-- | core/hmi.c | 2 | ||||
-rw-r--r-- | hw/fsp/fsp-codeupdate.c | 3 | ||||
-rw-r--r-- | include/skiboot.h | 1 |
4 files changed, 25 insertions, 0 deletions
diff --git a/core/fast-reboot.c b/core/fast-reboot.c index 66b3182..12ebf5b 100644 --- a/core/fast-reboot.c +++ b/core/fast-reboot.c @@ -281,6 +281,16 @@ static bool fast_reset_p8(void) extern void *fdt; extern struct lock capi_lock; +static const char *fast_reboot_disabled = NULL; +static struct lock fast_reboot_disabled_lock = LOCK_UNLOCKED; + +void disable_fast_reboot(const char *reason) +{ + lock(&fast_reboot_disabled_lock); + fast_reboot_disabled = reason; + unlock(&fast_reboot_disabled_lock); +} + void fast_reboot(void) { bool success; @@ -298,6 +308,15 @@ void fast_reboot(void) return; } + lock(&fast_reboot_disabled_lock); + if (fast_reboot_disabled) { + prlog(PR_DEBUG, "RESET: Fast reboot disabled because %s\n", + fast_reboot_disabled); + unlock(&fast_reboot_disabled_lock); + return; + } + unlock(&fast_reboot_disabled_lock); + lock(&capi_lock); for_each_chip(chip) { if (chip->capp_phb3_attached_mask) { @@ -836,6 +836,8 @@ int handle_hmi_exception(uint64_t hmer, struct OpalHMIEvent *hmi_evt) } } + if (recover == 0) + disable_fast_reboot("Unrecoverable HMI"); /* * HMER bits are sticky, once set to 1 they remain set to 1 until * they are set to 0. Reset the error source bit to 0, otherwise diff --git a/hw/fsp/fsp-codeupdate.c b/hw/fsp/fsp-codeupdate.c index 2263bf3..f17703a 100644 --- a/hw/fsp/fsp-codeupdate.c +++ b/hw/fsp/fsp-codeupdate.c @@ -1141,6 +1141,9 @@ static int64_t fsp_opal_update_flash(struct opal_sg_list *list) rc = OPAL_SUCCESS; goto out; } + + disable_fast_reboot("FSP Code Update"); + length = (be64_to_cpu(list->length) & ~(SG_LIST_VERSION << 56)) - 16; num_entries = length / sizeof(struct opal_sg_entry); if (num_entries <= 0) diff --git a/include/skiboot.h b/include/skiboot.h index 75c5207..97bdce7 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -190,6 +190,7 @@ extern unsigned long get_symbol(unsigned long addr, char **sym, char **sym_end); /* Fast reboot support */ +extern void disable_fast_reboot(const char *reason); extern void fast_reboot(void); extern void __noreturn __secondary_cpu_entry(void); extern void __noreturn load_and_boot_kernel(bool is_reboot); |