Skip to content

Commit

Permalink
MDIA: Updates to processCommandTimeout
Browse files Browse the repository at this point in the history
Change-Id: Iea9ed13bc2b38a48341530e62cc3cbbea5705f51
CQ: SW377890
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35510
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
  • Loading branch information
cnpalmer authored and zane131 committed Jan 30, 2017
1 parent 8363cdd commit 034c91c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 31 deletions.
3 changes: 2 additions & 1 deletion src/usr/diag/mdia/mdiafwd.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -91,6 +91,7 @@ enum

// mcbist unit regs
MCBIST_FIR = 0x07012300,
MCBIST_FIR_AND = 0x07012301,
MCBIST_FIR_MASK = 0x07012303,
MCBIST_FIR_ACT0 = 0x07012306,
MCBIST_FIR_ACT1 = 0x07012307,
Expand Down
78 changes: 48 additions & 30 deletions src/usr/diag/mdia/mdiasm.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -353,9 +353,10 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
size_t sz_uint64 = sizeof(uint64_t);

// Init data for MCBIST.
uint64_t firAddr = MCBIST_FIR;
uint64_t mskAddr = MCBIST_FIR_MASK;
uint64_t bitMask = 0x0020000000000000;
uint64_t firAddr = MCBIST_FIR;
uint64_t firAndAddr = MCBIST_FIR_AND;
uint64_t mskAddr = MCBIST_FIR_MASK;
uint64_t bitMask = 0x0028000000000000;

// Change if target type is MBA.
if ( TYPE_MBA == trgtType )
Expand All @@ -368,6 +369,7 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
// Check for command complete. If set, don't time out.
err = deviceRead( target, &firData, sz_uint64,
DEVICE_SCOM_ADDRESS(firAddr) );

if ( nullptr != err )
{
MDIA_FAST("sm: deviceRead on 0x%08X failed HUID:0x%08X",
Expand All @@ -380,6 +382,7 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
firData &= bitMask;
}

// TODO RTC 168088
if ( 0 != firData )
{
err = deviceRead( target, &mskData, sz_uint64,
Expand Down Expand Up @@ -443,6 +446,31 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
break;
}

/*@
* @errortype
* @reasoncode MDIA::MAINT_COMMAND_HW_TIMED_OUT
* @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
* @moduleid MDIA::PROCESS_COMMAND_TIMEOUT
* @userData1 Associated memory diag work item
* @userData2 Target HUID
* @devdesc A maint command HW timed out
*/
errlHndl_t timeoutErrl = new ErrlEntry(
ERRL_SEV_UNRECOVERABLE,
PROCESS_COMMAND_TIMEOUT,
MAINT_COMMAND_HW_TIMED_OUT,
*((*wit)->workItem),
get_huid(target));

// collect ffdc

addTimeoutFFDC(target, timeoutErrl);

timeoutErrl->addHwCallout(target,
HWAS::SRCI_PRIORITY_HIGH,
HWAS::DELAYED_DECONFIG,
HWAS::GARD_NULL);

// If maint cmd complete bit is not on, time out
MDIA_FAST("sm: stopping command: %p", target);
//target type is MBA
Expand Down Expand Up @@ -477,13 +505,28 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
{
fapi2::Target<fapi2::TARGET_TYPE_MCBIST> fapiMcbist(target);
fapi2::ReturnCode fapirc = memdiags::stop(fapiMcbist);

err = fapi2::rcToErrl(fapirc);

if ( nullptr != err )
{
MDIA_ERR("sm: memdiags::stop failed");
errlCommit(err, MDIA_COMP_ID);
}

//memdiags::stop will set the command complete attention so
//we need to clear those
bitMask = ~bitMask;

err = deviceWrite( target, &bitMask, sz_uint64,
DEVICE_SCOM_ADDRESS(firAndAddr) );

if ( nullptr != err )
{
MDIA_FAST( "sm: deviceWrite on 0x%08X failed, HUID: "
"0x%08X", firAddr, get_huid(target) );
errlCommit(err, MDIA_COMP_ID);
}
}

(*wit)->data = NULL;
Expand All @@ -497,32 +540,7 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
*((*wit)->workItem),
get_huid(target));

/*@
* @errortype
* @reasoncode MDIA::MAINT_COMMAND_HW_TIMED_OUT
* @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
* @moduleid MDIA::PROCESS_COMMAND_TIMEOUT
* @userData1 Associated memory diag work item
* @userData2 Target HUID
* @devdesc A maint command HW timed out
*/
err = new ErrlEntry(
ERRL_SEV_UNRECOVERABLE,
PROCESS_COMMAND_TIMEOUT,
MAINT_COMMAND_HW_TIMED_OUT,
*((*wit)->workItem),
get_huid(target));

// collect ffdc

addTimeoutFFDC(target, err);

err->addHwCallout(target,
HWAS::SRCI_PRIORITY_HIGH,
HWAS::DELAYED_DECONFIG,
HWAS::GARD_NULL);

errlCommit(err, MDIA_COMP_ID);
errlCommit(timeoutErrl, MDIA_COMP_ID);

break;
}
Expand Down

0 comments on commit 034c91c

Please sign in to comment.