@@ -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
@@ -1126,6 +1126,8 @@ static int64_t fsp_opal_update_flash(struct opal_sg_list *list)
struct opal_sg_entry *entry;
int length, num_entries, result = 0, rc = OPAL_PARAMETER;
+ disable_fast_reboot("FSP Code Update");
+
/* Ensure that the sg list honors our alignment requirements */
rc = validate_sglist(list);
if (rc) {
@@ -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);