diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2018-09-11 15:41:39 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-09-14 15:38:00 -0500 |
commit | 7bb1f127506943f90e153c7013fa026b42959069 (patch) | |
tree | deb5b430dc79a1419bcf00ff89d9e61f5df4f416 /src/import/chips/p9/procedures/hwp/pm | |
parent | 55a1d38302ca1a4f51b8e04fd1ba33b069b775f7 (diff) | |
download | talos-hostboot-7bb1f127506943f90e153c7013fa026b42959069.tar.gz talos-hostboot-7bb1f127506943f90e153c7013fa026b42959069.zip |
Skip PM FFDC collection if the HOMER is not valid
There are scenarios where pm_reset can be called without a valid
HOMER image. This change prevents the code from trying to access
the invalid memory.
Change-Id: Ifb13c98d668e83ba111d246e501cb281687f33a9
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66016
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Prem Shanker Jha <premjha2@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66019
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/pm')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C index 982f823b8..208949a8a 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C @@ -458,6 +458,10 @@ fapi2::ReturnCode p9_pm_reset( FAPI_TRY (FAPI_ATTR_SET (fapi2::ATTR_PM_RESET_PHASE, i_target, l_phase)); fapi_try_exit: + // current_err can get overridden by any call to FAPI_TRY so we + // need to save it away before we execute additional code + fapi2::ReturnCode l_current_err = fapi2::current_err; + // Update PM FFDC Section Header with Miscellaneous Info l_rc = p9_pm_collect_ffdc (i_target, i_pHomerImage, PLAT_MISC); @@ -471,7 +475,7 @@ fapi_try_exit: FAPI_ATTR_GET (fapi2::ATTR_PM_RESET_PHASE, i_target, l_phase); FAPI_IMP("<< p9_pm_reset: Phase 0x%02X", l_phase); - return fapi2::current_err; + return l_current_err; } fapi2::ReturnCode @@ -749,6 +753,12 @@ fapi2::ReturnCode p9_pm_collect_ffdc ( fapi2::ENUM_ATTR_PM_RESET_FFDC_ENABLE_FALSE; fapi2::ATTR_PM_RESET_PHASE_Type l_phase = PM_RESET_UNKNOWN; + if( i_pHomerImage == nullptr ) + { + FAPI_INF ("HOMER is not valid, skipping p9_pm_collect_ffdc"); + goto fapi_try_exit; + } + FAPI_TRY (FAPI_ATTR_GET (fapi2::ATTR_PM_RESET_PHASE, i_target, l_phase)); FAPI_TRY (FAPI_ATTR_GET (fapi2::ATTR_PM_RESET_FFDC_ENABLE, FAPI_SYSTEM, l_ffdcEnable)); |