Skip to content

Commit

Permalink
Properly Commit Physical Presence Detection Error Logs
Browse files Browse the repository at this point in the history
This fixes a bug where any error being propogated up the istep
stack was not being committed. It also fixes a missing error
check and updates some trace collection.

Change-Id: I3da4ee8cdef63798b13ba9347e97c233dd71f5de
RTC:210301
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/94516
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com>
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: Nicholas E Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mabaiocchi authored and dcrowell77 committed Apr 9, 2020
1 parent d4e588d commit 2337465
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/include/usr/ipmi/ipmisensor.H
Expand Up @@ -1069,7 +1069,7 @@ namespace SENSOR
* maintained by the BMC.
*
* Usage:
* uint8_t key_clear_request_value = 0x0100;
* uint8_t key_clear_request_value = 0x01; //MSByte of Key Clear value
* KeyClearRequestSensor l_sensor;
* l_sensor.setKeyClearRequestValue( key_clear_request_value );
*
Expand Down
4 changes: 2 additions & 2 deletions src/usr/ipmiext/ipmisensor.C
Expand Up @@ -1035,7 +1035,7 @@ namespace SENSOR
//
errlHndl_t KeyClearRequestSensor::setKeyClearRequest(const uint8_t i_value)
{
// This is a threshhhold sensor that sets one byte of data in the
// This is a threshold sensor that sets one byte of data in the
// iv_sensor_reading field
iv_msg->iv_sensor_reading = i_value;

Expand All @@ -1047,7 +1047,7 @@ namespace SENSOR
//
errlHndl_t KeyClearRequestSensor::getKeyClearRequest( uint8_t &o_value )
{
// This is a threshhhold sensor that returns one byte of data in
// This is a threshold sensor that returns one byte of data in
// the sensor_status field
getSensorReadingData l_data;

Expand Down
1 change: 1 addition & 0 deletions src/usr/isteps/istep06/call_host_update_master_tpm.C
Expand Up @@ -80,6 +80,7 @@ void* call_host_update_master_tpm( void *io_pArgs )
TRACE_ERR_FMT,
TRACE_ERR_ARGS(l_err));
l_stepError.addErrorDetails(l_err);
ERRORLOG::errlCommit( l_err, SECURE_COMP_ID );
}
#endif

Expand Down
28 changes: 19 additions & 9 deletions src/usr/secureboot/ext/phys_presence.C
Expand Up @@ -125,15 +125,15 @@ errlHndl_t detectPhysPresence(void)
TRACE_ERR_FMT,
TRACE_ERR_ARGS(err));

err->collectTrace(SECURE_COMP_NAME);
break;
}

// Get the attribute with the needed GPIO information
if (mproc->tryGetAttr<ATTR_GPIO_INFO_PHYS_PRES>(gpioInfo))
{
SB_INF("detectPhysPresence: gpioInfo: e%d/p%d/devAddr=0x%X, "
"windowOpenPin=%d, physPresPin=%d",
SB_INF("detectPhysPresence: gpioInfo: mproc=0x%0.8X "
"e%d/p%d/devAddr=0x%X, windowOpenPin=%d, physPresPin=%d",
get_huid(mproc),
gpioInfo.engine, gpioInfo.port, gpioInfo.devAddr,
gpioInfo.windowOpenPin, gpioInfo.physicalPresencePin);
}
Expand Down Expand Up @@ -161,7 +161,6 @@ errlHndl_t detectPhysPresence(void)
ATTR_GPIO_INFO_PHYS_PRES,
ErrlEntry::ADD_SW_CALLOUT);

err->collectTrace( SECURE_COMP_NAME );
break;
}

Expand Down Expand Up @@ -313,7 +312,6 @@ errlHndl_t detectPhysPresence(void)
"there was no key clear request: "
TRACE_ERR_FMT,
TRACE_ERR_ARGS(err_close));
err_close->collectTrace( SECURE_COMP_NAME );
}

if (err)
Expand All @@ -333,7 +331,6 @@ errlHndl_t detectPhysPresence(void)
SB_ERR("detectPhysPresence: Error in closing window. "
TRACE_ERR_FMT,
TRACE_ERR_ARGS(err));
err_close->collectTrace( SECURE_COMP_NAME );
err = err_close;
err_close = nullptr;
}
Expand Down Expand Up @@ -363,6 +360,10 @@ errlHndl_t detectPhysPresence(void)
errlCommit(err, SECURE_COMP_ID);
err = nullptr;
}
else if (err != nullptr)
{
err->collectTrace( SECURE_COMP_NAME );
}

SB_EXIT("detectPhysPresence: err rc=0x%X",
ERRL_GETRC_SAFE(err));
Expand Down Expand Up @@ -504,8 +505,6 @@ errlHndl_t handlePhysPresenceWindow(void)
"failed. "
TRACE_ERR_FMT,
TRACE_ERR_ARGS(err));

err->collectTrace(SECURE_COMP_NAME);
break;
}

Expand All @@ -520,6 +519,13 @@ errlHndl_t handlePhysPresenceWindow(void)
(led_window_open),
PCA9551_OUTPUT_LOW,
led_data);
if(err)
{
SB_ERR("handlePhysPresenceWindow: call to gpioPca9551SetLed failed. "
TRACE_ERR_FMT,
TRACE_ERR_ARGS(err));
break;
}

// Verify that the "window open" LED is set
// LEDs/PINs represent "WINDOW_OPEN_N" and "PHYS_PRESENCE_N" so need
Expand Down Expand Up @@ -560,7 +566,6 @@ errlHndl_t handlePhysPresenceWindow(void)
led_window_open),
ErrlEntry::ADD_SW_CALLOUT);

err->collectTrace( SECURE_COMP_NAME );
break;
}

Expand Down Expand Up @@ -618,6 +623,7 @@ errlHndl_t handlePhysPresenceWindow(void)
"attributes to FSP. "
TRACE_ERR_FMT,
TRACE_ERR_ARGS(err));
err->collectTrace( SECURE_COMP_NAME );
errlCommit(err,SECURE_COMP_ID );
}
}
Expand Down Expand Up @@ -662,6 +668,10 @@ errlHndl_t handlePhysPresenceWindow(void)
errlCommit(err, SECURE_COMP_ID);
err = nullptr;
}
else if (err != nullptr)
{
err->collectTrace( SECURE_COMP_NAME );
}

SB_EXIT("handlePhysPresenceWindow: err_rc=0x%X",
ERRL_GETRC_SAFE(err));
Expand Down

0 comments on commit 2337465

Please sign in to comment.