From b6badfcb9d8b906f8412478b5d347926e5f00273 Mon Sep 17 00:00:00 2001 From: Caleb Palmer Date: Wed, 11 Mar 2020 16:28:09 -0500 Subject: [PATCH] MDIA: Update timeout FFDC gathering for OCMBs Change-Id: Ib3104995bd97515b1e94d2b6e0e11517a9eeaa14 RTC: 250934 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/93200 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Reviewed-by: Benjamen G Tyner Reviewed-by: Zane C Shelley Reviewed-by: Brian J Stegmiller Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins --- src/usr/diag/mdia/mdiasm.C | 20 +++-- src/usr/diag/mdia/mdiasm.H | 11 ++- src/usr/diag/mdia/test/makefile | 4 +- src/usr/diag/mdia/test/mdiaTestTimeoutFfdc.H | 95 ++++++++++++++++++++ src/usr/diag/mdia/test/mdiatestmba.H | 2 +- src/usr/diag/mdia/test/mdiatestsm.H | 4 +- 6 files changed, 124 insertions(+), 12 deletions(-) create mode 100644 src/usr/diag/mdia/test/mdiaTestTimeoutFfdc.H diff --git a/src/usr/diag/mdia/mdiasm.C b/src/usr/diag/mdia/mdiasm.C index 531597b469c..eec6918fd73 100644 --- a/src/usr/diag/mdia/mdiasm.C +++ b/src/usr/diag/mdia/mdiasm.C @@ -131,7 +131,6 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log) MCBIST_FIR_ACT1, }; - /* TODO const uint64_t ocmbRegs[] = { OCMB_MCBIST_FIR, OCMB_MCBIST_FIR_AND, @@ -144,7 +143,6 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log) OMIDLFIR_ACT0, OMIDLFIR_ACT1, }; - */ const uint64_t procRegs[] = { IPOLL_MASK, @@ -258,9 +256,20 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log) } else if ( TYPE_OCMB_CHIP == i_target->getAttr() ) { - /* - // get the parent proc - ConstTargetHandle_t proc = getParentChip(i_target); + // Get the parent OMI + TargetHandleList targetList; + getParentAffinityTargets( targetList, i_target, CLASS_UNIT, TYPE_OMI ); + + assert( targetList.size() == 1, "[MDIA] addTimeoutFFDC: Multiple parent" + " OMIs found for OCMB i_target: 0x%08x", get_huid(i_target) ); + + TargetHandle_t omi = targetList[0]; + + // Get the parent proc + ConstTargetHandle_t proc = getParentChip(omi); + + assert( nullptr != proc, "[MDIA] addTimeoutFFDC: Unable to get the " + "parent proc from omi: 0x%08x", get_huid(omi) ); const struct Entry { @@ -291,7 +300,6 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log) udLogRegister.addToLog(io_log); } } - */ } else { diff --git a/src/usr/diag/mdia/mdiasm.H b/src/usr/diag/mdia/mdiasm.H index 55cc8ed74f4..23dd61e82d3 100644 --- a/src/usr/diag/mdia/mdiasm.H +++ b/src/usr/diag/mdia/mdiasm.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2019 */ +/* Contributors Listed Below - COPYRIGHT 2012,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -64,6 +64,15 @@ enum WorkFlowPhase ANALYZE_IPL_MNFG_CE_STATS, }; +/** + * @brief Add relevant register FFDC for a MDIA timeout + * + * @param[in] i_target The target to collect the FFDC for + * @param[in/out] io_log The error log to add the FFDC to + */ + +void addTimeoutFFDC(TARGETING::TargetHandle_t i_target, errlHndl_t & io_log); + /** * @brief determine whether the TargetType should be MBA or MCBIST * diff --git a/src/usr/diag/mdia/test/makefile b/src/usr/diag/mdia/test/makefile index 571c701e052..b3a2415b90c 100644 --- a/src/usr/diag/mdia/test/makefile +++ b/src/usr/diag/mdia/test/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2012,2017 +# Contributors Listed Below - COPYRIGHT 2012,2020 # [+] International Business Machines Corp. # # @@ -47,6 +47,6 @@ OBJS += mdiafakecm.o MODULE = testmdia -TESTS = mdiatestsm.H mdiatesttrace.H mdiatest.H mdiatestworkitem.H mdiatestmonitor.H mdiatestmba.H +TESTS = mdiatestsm.H mdiatesttrace.H mdiatest.H mdiatestworkitem.H mdiatestmonitor.H mdiatestmba.H mdiaTestTimeoutFfdc.H include ${ROOTPATH}/config.mk diff --git a/src/usr/diag/mdia/test/mdiaTestTimeoutFfdc.H b/src/usr/diag/mdia/test/mdiaTestTimeoutFfdc.H new file mode 100644 index 00000000000..fcc8e571ae0 --- /dev/null +++ b/src/usr/diag/mdia/test/mdiaTestTimeoutFfdc.H @@ -0,0 +1,95 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/mdia/test/mdiaTestTimeoutFfdc.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2020 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __TEST_MDIATESTTIMEOUTFFDC_H +#define __TEST_MDIATESTTIMEOUTFFDC_H + +/** + * @file mdiaTestTimeoutFfdc.H + * @brief Timeout FFDC collection unit test + */ + +#include +#include +#include "../mdiasm.H" +#include "../mdiasmimpl.H" +#include +#include "../mdiatrace.H" +#include "../mdiamonitor.H" +#include "../mdiafwd.H" +#include + +using namespace MDIA; +using namespace TARGETING; + +class MdiaTimeoutFfdcTest : public CxxTest::TestSuite +{ + private: + + TargetHandle_t getTarget() + { + TargetHandleList tmp; + + // Need to determine whether we are using MBA, MCBIST, or OCMB + fapi2::TargetType type = getMdiaTargetType(); + if (fapi2::TARGET_TYPE_MBA_CHIPLET == type) + { + TARGETING::getAllChiplets(tmp, TYPE_MBA); + } + else if (fapi2::TARGET_TYPE_MCBIST == type) + { + TARGETING::getAllChiplets(tmp, TYPE_MCBIST); + } + else if (fapi2::TARGET_TYPE_OCMB_CHIP == type) + { + TARGETING::getAllChips(tmp, TYPE_OCMB_CHIP); + } + + return tmp[0]; + } + + public: + + void testTimeoutFfdc(void) + { + using namespace MDIA; + using namespace TARGETING; + + TS_TRACE(ENTER_MRK "testOcmbTimeoutFfdc"); + + // Just call addTimeoutFFDC with some appropriate target to ensure + // it doesn't assert or crash. + TargetHandle_t trgt = getTarget(); + errlHndl_t err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + PROCESS_COMMAND_TIMEOUT, + MAINT_COMMAND_SW_TIMED_OUT, + get_huid(trgt) ); + addTimeoutFFDC( trgt, err ); + + TS_TRACE(EXIT_MRK "testOcmbTimeoutFfdc"); + } + +}; +#endif diff --git a/src/usr/diag/mdia/test/mdiatestmba.H b/src/usr/diag/mdia/test/mdiatestmba.H index 97360c80a0c..1427d6b3bfd 100644 --- a/src/usr/diag/mdia/test/mdiatestmba.H +++ b/src/usr/diag/mdia/test/mdiatestmba.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2019 */ +/* Contributors Listed Below - COPYRIGHT 2012,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/diag/mdia/test/mdiatestsm.H b/src/usr/diag/mdia/test/mdiatestsm.H index b7df7d954aa..04993ddbda9 100644 --- a/src/usr/diag/mdia/test/mdiatestsm.H +++ b/src/usr/diag/mdia/test/mdiatestsm.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2018 */ +/* Contributors Listed Below - COPYRIGHT 2012,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -64,7 +64,7 @@ class MdiaSmTest : public CxxTest::TestSuite } else if (fapi2::TARGET_TYPE_OCMB_CHIP == type) { - TARGETING::getAllChiplets(tmp, TYPE_OCMB_CHIP); + TARGETING::getAllChips(tmp, TYPE_OCMB_CHIP); } TargetHandleList::iterator it = tmp.end();