[Skiboot] [PATCH] fast-reboot: disable on FSP code update or unrecoverable HMI

Stewart Smith stewart at linux.vnet.ibm.com
Mon Oct 24 18:46:45 AEDT 2016


Mahesh Jagannath Salgaonkar <mahesh at linux.vnet.ibm.com> writes:
> On 10/24/2016 11:58 AM, Stewart Smith wrote:
>> Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
>> ---
>>  core/fast-reboot.c      | 18 ++++++++++++++++++
>>  core/hmi.c              |  2 ++
>>  hw/fsp/fsp-codeupdate.c |  2 ++
>>  include/skiboot.h       |  1 +
>>  4 files changed, 23 insertions(+)
>> 
>> diff --git a/core/fast-reboot.c b/core/fast-reboot.c
>> index 66b31824c9eb..7f861b9760cd 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,14 @@ 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);
>
> Shouldn't we unlock and return ?

Yes... although the slow reboot will *technically* unlock it :)

>
>> +		return;
>> +	}
>> +	unlock(&fast_reboot_disabled_lock);
>> +
>>  	lock(&capi_lock);
>>  	for_each_chip(chip) {
>>  		if (chip->capp_phb3_attached_mask) {
>> diff --git a/core/hmi.c b/core/hmi.c
>> index 69403c6db350..6fe060dc7c56 100644
>> --- a/core/hmi.c
>> +++ b/core/hmi.c
>> @@ -836,6 +836,8 @@ int handle_hmi_exception(uint64_t hmer, struct OpalHMIEvent *hmi_evt)
>>  		}
>>  	}
>>  
>> +	if (recover == 0)
>> +		disable_fast_reboot("Unrecoverable HMI");
>
> This only fixes platform error reported by HMI.. What about memory
> errors like memory UE ?
>
> I think we should disable fast reboot from opal_cec_reboot2() under
> 'OPAL_REBOOT_PLATFORM_ERROR' switch case. Linux always call
> opal_cec_reboot2() on any platform errors reported to it e.g.
> unrecoverable HMI or MCE. What do you think ?

I think that's a good place to do it too.

A TODO is to check FIRs themselves of course.

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list