Skip to content

Commit

Permalink
MDIA: Update timeout FFDC gathering for OCMBs
Browse files Browse the repository at this point in the history
Change-Id: Ib3104995bd97515b1e94d2b6e0e11517a9eeaa14
RTC: 250934
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/93200
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamen G Tyner <ben.tyner@ibm.com>
Reviewed-by: Zane C Shelley <zshelle@us.ibm.com>
Reviewed-by: Brian J Stegmiller <bjs@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>
  • Loading branch information
cnpalmer authored and zane131 committed Mar 19, 2020
1 parent f07d459 commit b6badfc
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 12 deletions.
20 changes: 14 additions & 6 deletions src/usr/diag/mdia/mdiasm.C
Expand Up @@ -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,
Expand All @@ -144,7 +143,6 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log)
OMIDLFIR_ACT0,
OMIDLFIR_ACT1,
};
*/

const uint64_t procRegs[] = {
IPOLL_MASK,
Expand Down Expand Up @@ -258,9 +256,20 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log)
}
else if ( TYPE_OCMB_CHIP == i_target->getAttr<ATTR_TYPE>() )
{
/*
// 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
{
Expand Down Expand Up @@ -291,7 +300,6 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log)
udLogRegister.addToLog(io_log);
}
}
*/
}
else
{
Expand Down
11 changes: 10 additions & 1 deletion src/usr/diag/mdia/mdiasm.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* Contributors Listed Below - COPYRIGHT 2012,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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
*
Expand Down
4 changes: 2 additions & 2 deletions src/usr/diag/mdia/test/makefile
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2012,2017
# Contributors Listed Below - COPYRIGHT 2012,2020
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -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
95 changes: 95 additions & 0 deletions 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 <builtins.h>
#include <cxxtest/TestSuite.H>
#include "../mdiasm.H"
#include "../mdiasmimpl.H"
#include <targeting/common/utilFilter.H>
#include "../mdiatrace.H"
#include "../mdiamonitor.H"
#include "../mdiafwd.H"
#include <sys/time.h>

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
2 changes: 1 addition & 1 deletion src/usr/diag/mdia/test/mdiatestmba.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* Contributors Listed Below - COPYRIGHT 2012,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down
4 changes: 2 additions & 2 deletions src/usr/diag/mdia/test/mdiatestsm.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* Contributors Listed Below - COPYRIGHT 2012,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b6badfc

Please sign in to comment.