[Skiboot] [PATCH v3 1/2] opal-api: Add OPAL call to handle abnormal reboots.

Samuel Mendoza-Jonas sam.mj at au1.ibm.com
Wed Jul 29 15:07:08 AEST 2015


On 29/07/15 04:05, Mahesh J Salgaonkar wrote:
> From: Vipin K Parashar <vipin at linux.vnet.ibm.com>
> 
> This patch adds a new OPAL call OPAL_CEC_REBOOT2 which will
> be used to handle abnormal reboot/termination by kernel host.
> 
> This call will allow host kernel to pass reboot type and additional
> debug data which needs to be captured/saved somewhere (for later
> analysis) before going down.
> 
> Currently it will support two reboot types (0). normal reboot, that
> will behave similar to that of opal_cec_reboot() call, and
> (1). platform error reboot, that will trigger a system checkstop
> using xscom address and FIR bit information obtained via device-tree
> property 'ibm,sw-checkstop-fir'.
> 
> For unsupported reboot type, this call will do nothing and return
> with OPAL_UNSUPPORTED.
> 
> In future, we can overload this call to support additional reboot types.
> 
> Signed-off-by: Vipin K Parashar <vipin at linux.vnet.ibm.com>
> Signed-off-by: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
> ---
>  core/platform.c    |   37 +++++++++++++++++++++++++++++++++++++
>  hw/xscom.c         |   32 ++++++++++++++++++++++++++++++++
>  include/errorlog.h |    3 +++
>  include/opal-api.h |    9 ++++++++-
>  include/xscom.h    |    1 +
>  5 files changed, 81 insertions(+), 1 deletion(-)
> 
> diff --git a/core/platform.c b/core/platform.c
> index dec7e96..272f2db 100644
> --- a/core/platform.c
> +++ b/core/platform.c
> @@ -21,9 +21,18 @@
>  #include <timebase.h>
>  #include <cpu.h>
>  #include <chip.h>
> +#include <xscom.h>
> +#include <errorlog.h>
>  
>  struct platform	platform;
>  
> +static void reboot_err_info_dump(struct errorlog *buf, void *data,
> +				 uint16_t size);
> +
> +DEFINE_LOG_ENTRY(OPAL_RC_ABNORMAL_REBOOT, OPAL_PLATFORM_ERR_EVT, OPAL_CEC,
> +		 OPAL_CEC_HARDWARE, OPAL_PREDICTIVE_ERR_FAULT_RECTIFY_REBOOT,
> +		 OPAL_ABNORMAL_POWER_OFF, reboot_err_info_dump);
> +
>  /*
>   * Various wrappers for platform functions
>   */

(copying my response from the other thread so it's visible here as well)

> Sam Jonas changed this function signature a couple of days ago. You will
> have to co-ordinate with him so there are no build issues.

Good catch - yep my patches yesterday, specifically "[PATCH 1/3] errorlog:
Simplify log calling convention" deprecates this call-back method
of logging extra data.

If those patches go in the new method is simple to update to - just get
rid of the reboot_err_info_dump callback and instead change the
call to log_error() to a log_append_msg() and log_append_data().

Alternately if your patches go in first I can update the calling
convention as part of my patches; I'll coordinate with Stewart.

Thanks,
Sam



-- 
-----------
LTC Ozlabs
IBM



More information about the Skiboot mailing list