Skip to content

Commit

Permalink
Fix excessive traces for BCE requests, slave data collection and opal…
Browse files Browse the repository at this point in the history
… updates

Correct power cap information in OPAL shared memory

Add non-zero error history counts to poll response

Fix Characterization to Active State change failure

Change-Id: I92b783b631e79786e6190a4def520fee32c2cc7c
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43216
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
  • Loading branch information
marthabroyles committed Jul 19, 2017
1 parent 98f0808 commit 67f48d4
Show file tree
Hide file tree
Showing 16 changed files with 589 additions and 292 deletions.
42 changes: 41 additions & 1 deletion src/occ_405/cmdh/cmdh_fsp_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
{
ERRL_RC l_rc = ERRL_RC_INTERNAL_FAIL;
uint8_t k = 0, l_max_sensors = 0;
uint8_t l_err_hist_idx = 0, l_sens_list_idx = 0;
cmdh_poll_sensor_db_t l_sensorHeader;

// Set pointer to start of o_rsp_ptr
Expand Down Expand Up @@ -562,7 +563,7 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
l_sensorHeader.length = sizeof(cmdh_poll_extn_sensor_t);
l_sensorHeader.count = 0;

cmdh_poll_extn_sensor_t l_extnSensorList[4] = {{0}};
cmdh_poll_extn_sensor_t l_extnSensorList[MAX_EXTN_SENSORS] = {{0}};
l_extnSensorList[l_sensorHeader.count].name = EXTN_NAME_FMIN;
uint16_t freq = G_sysConfigData.sys_mode_freq.table[OCC_MODE_MIN_FREQUENCY];
l_extnSensorList[l_sensorHeader.count].data[0] = proc_freq2pstate(freq);
Expand Down Expand Up @@ -594,6 +595,45 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
}
l_sensorHeader.count++;

// add any non-0 error history counts
for(l_err_hist_idx=0; l_err_hist_idx < ERR_HISTORY_SIZE; l_err_hist_idx++)
{
if(G_error_history[l_err_hist_idx])
{
if(l_sens_list_idx == 0)
{
// first one to add fill in name
l_extnSensorList[l_sensorHeader.count].name = EXTN_NAME_ERRHIST;
l_extnSensorList[l_sensorHeader.count].data[l_sens_list_idx] = l_err_hist_idx;
l_sens_list_idx++;
l_extnSensorList[l_sensorHeader.count].data[l_sens_list_idx] = G_error_history[l_err_hist_idx];
l_sens_list_idx++;
}
else if(l_sens_list_idx < 5) // room in current extended error history sensor?
{
l_extnSensorList[l_sensorHeader.count].data[l_sens_list_idx] = l_err_hist_idx;
l_sens_list_idx++;
l_extnSensorList[l_sensorHeader.count].data[l_sens_list_idx] = G_error_history[l_err_hist_idx];
l_sens_list_idx++;
}
else // no room start another extended error history sensor
{
l_sensorHeader.count++;
l_extnSensorList[l_sensorHeader.count].name = EXTN_NAME_ERRHIST;
l_sens_list_idx = 0;
l_extnSensorList[l_sensorHeader.count].data[l_sens_list_idx] = l_err_hist_idx;
l_sens_list_idx++;
l_extnSensorList[l_sensorHeader.count].data[l_sens_list_idx] = G_error_history[l_err_hist_idx];
l_sens_list_idx++;
}
}
}
if(l_sens_list_idx)
{
l_sensorHeader.count++;
}


// Copy header to response buffer.
memcpy ((void *) &(o_rsp_ptr->data[l_rsp_index]), (void *)&l_sensorHeader, sizeof(l_sensorHeader));
//Increment index into response buffer.
Expand Down
2 changes: 2 additions & 0 deletions src/occ_405/cmdh/cmdh_fsp_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ typedef enum
#define EXTN_NAME_FNOM 0x464E4F4D // "FNOM"
#define EXTN_NAME_FTURBO 0x46540000 // "FT"
#define EXTN_NAME_FUTURBO 0x46555400 // "FUT"
#define EXTN_NAME_ERRHIST 0x45525248 // "ERRH"

#define MAX_EXTN_SENSORS 32
//---------------------------------------------------------
// Poll Command
//---------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,6 @@ errlHndl_t data_store_power_cap(const cmdh_fsp_cmd_t * i_cmd_ptr,
cmdh_pcap_config_t * l_cmd_ptr = (cmdh_pcap_config_t *)i_cmd_ptr;
uint16_t l_data_length = 0;
uint32_t l_pcap_data_sz = 0;
static uint8_t L_pcap_count = 0;
bool l_invalid_input = TRUE; //Assume bad input

l_data_length = CONVERT_UINT8_ARRAY_UINT16(l_cmd_ptr->data_length[0], l_cmd_ptr->data_length[1]);
Expand Down Expand Up @@ -1475,8 +1474,7 @@ errlHndl_t data_store_power_cap(const cmdh_fsp_cmd_t * i_cmd_ptr,
// It tells the master and slave code that there is new
// pcap data. This should not be incremented until
// after the packet data has been copied into G_master_pcap_data.
L_pcap_count++;
G_master_pcap_data.pcap_data_count = L_pcap_count;
G_master_pcap_data.pcap_data_count++;

// Change Data Request Mask to indicate we got the data
// G_data_cnfg->data_mask |= DATA_MASK_PCAP_PRESENT;
Expand Down
3 changes: 3 additions & 0 deletions src/occ_405/dcom/dcom.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
#define MAX_WAIT_FOR_SLAVES 400
#define MAX_WAIT_FOR_MASTER 400

// number of consecutive times a BCE request is not idle before tracing
#define DCOM_TRACE_NOT_IDLE_AFTER_CONSEC_TIMES 3

// general defines
#define TOD_SIZE 6
#define NUM_TOD_SENSORS 3
Expand Down
40 changes: 29 additions & 11 deletions src/occ_405/dcom/dcomMasterRx.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ void setbit_slvoutbox_complete(uint8_t i_bit)
// End Function Specification
void task_dcom_rx_slv_outboxes( task_t *i_self)
{
static uint32_t L_wait4slaves = 0;
static uint32_t L_wait4slaves = 0;
static uint8_t L_bce_not_ready_count = 0;
uint32_t l_orc = OCC_SUCCESS_REASON_CODE;
uint32_t l_orc_ext = OCC_NO_EXTENDED_RC;
uint8_t l_slv_response_mask = 0;
Expand Down Expand Up @@ -216,16 +217,20 @@ void task_dcom_rx_slv_outboxes( task_t *i_self)
// represents a hang condition that we can't recover from.
// DO NOT proceed with request create and schedule.
l_proceed_with_request_and_schedule = FALSE;
// Trace important information from the request
TRAC_INFO("BCE slv outbox rx request not idle and not complete, callback_rc[%d] options[0x%x] state[0x%x] abort_state[0x%x] completion_state[0x%x]",
G_slv_outbox_rx_pba_request[l_slv].request.callback_rc,
G_slv_outbox_rx_pba_request[l_slv].request.options,
G_slv_outbox_rx_pba_request[l_slv].request.state,
G_slv_outbox_rx_pba_request[l_slv].request.abort_state,
G_slv_outbox_rx_pba_request[l_slv].request.completion_state);

TRAC_INFO("NOT proceeding with BCE slv outbox rx request and schedule for slave[0x%02X]",
l_slv);
if(L_bce_not_ready_count == DCOM_TRACE_NOT_IDLE_AFTER_CONSEC_TIMES)
{
// Trace important information from the request
TRAC_INFO("BCE slv outbox rx request not idle and not complete, callback_rc[%d] options[0x%x] state[0x%x] abort_state[0x%x] completion_state[0x%x]",
G_slv_outbox_rx_pba_request[l_slv].request.callback_rc,
G_slv_outbox_rx_pba_request[l_slv].request.options,
G_slv_outbox_rx_pba_request[l_slv].request.state,
G_slv_outbox_rx_pba_request[l_slv].request.abort_state,
G_slv_outbox_rx_pba_request[l_slv].request.completion_state);

TRAC_INFO("NOT proceeding with BCE slv outbox rx request and schedule for slave[0x%02X]",
l_slv);
}
}
else
{
Expand All @@ -235,6 +240,13 @@ void task_dcom_rx_slv_outboxes( task_t *i_self)
// Only proceed if the BCE request state checked out
if (l_proceed_with_request_and_schedule)
{
if(L_bce_not_ready_count >= DCOM_TRACE_NOT_IDLE_AFTER_CONSEC_TIMES) // previously not idle
{
TRAC_INFO("BCE slv outbox rx request idle and complete after %d times", L_bce_not_ready_count);
}

L_bce_not_ready_count = 0;

// Copy request from main memory to SRAM
l_ssxrc = bce_request_create(
&G_slv_outbox_rx_pba_request[l_slv], // block copy object
Expand Down Expand Up @@ -283,6 +295,11 @@ void task_dcom_rx_slv_outboxes( task_t *i_self)
break;
}
}
else
{
L_bce_not_ready_count++;
INCREMENT_ERR_HISTORY(ERR_DCOM_RX_SLV_OUTBOX);
}
}
else
{
Expand Down Expand Up @@ -366,7 +383,8 @@ uint32_t dcom_rx_slv_outbox_doorbell( void )

if (l_pbarc != 0)
{
// Failure occurred but only trace it once
INCREMENT_ERR_HISTORY(ERR_DCOM_MASTER_PBAX_READ_FAIL);

TRAC_ERR("Master PBAX Read Failure in receiving unicast slave doorbells - RC[%08X]", l_pbarc);

// Handle pbax read failure on queue 1
Expand Down
37 changes: 29 additions & 8 deletions src/occ_405/dcom/dcomMasterTx.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ uint32_t dcom_build_slv_inbox(void)
// interrupt context.
if(G_pbax_rc)
{
INCREMENT_ERR_HISTORY(ERR_DCOM_MASTER_PBAX_SEND_FAIL);

if (!L_traced)
{
TRAC_INFO("PBAX Send Failure in transimitting multicast doorbell - RC[%08X], packet[%d]", G_pbax_rc, G_pbax_packet);
Expand Down Expand Up @@ -225,6 +227,7 @@ uint32_t dcom_which_buffer(void)
void task_dcom_tx_slv_inbox( task_t *i_self)
{
static bool L_error = FALSE;
static uint8_t L_bce_not_ready_count = 0;
uint32_t l_orc = OCC_SUCCESS_REASON_CODE;
uint32_t l_orc_ext = OCC_NO_EXTENDED_RC;
uint64_t l_start = ssx_timebase_get();
Expand Down Expand Up @@ -320,14 +323,17 @@ void task_dcom_tx_slv_inbox( task_t *i_self)
// DO NOT proceed with request create and schedule.
l_proceed_with_request_and_schedule = FALSE;

// Trace important information from the request
TRAC_INFO("BCE slv inbox tx request not idle and not complete: callback_rc[%d] options[0x%x] state[0x%x] abort_state[0x%x] completion_state[0x%x]",
G_slv_inbox_tx_pba_request.request.callback_rc,
G_slv_inbox_tx_pba_request.request.options,
G_slv_inbox_tx_pba_request.request.state,
G_slv_inbox_tx_pba_request.request.abort_state,
G_slv_inbox_tx_pba_request.request.completion_state);
TRAC_INFO("NOT proceeding with BCE slv inbox tx request and schedule");
if(L_bce_not_ready_count == DCOM_TRACE_NOT_IDLE_AFTER_CONSEC_TIMES)
{
// Trace important information from the request
TRAC_INFO("BCE slv inbox tx request not idle and not complete: callback_rc[%d] options[0x%x] state[0x%x] abort_state[0x%x] completion_state[0x%x]",
G_slv_inbox_tx_pba_request.request.callback_rc,
G_slv_inbox_tx_pba_request.request.options,
G_slv_inbox_tx_pba_request.request.state,
G_slv_inbox_tx_pba_request.request.abort_state,
G_slv_inbox_tx_pba_request.request.completion_state);
TRAC_INFO("NOT proceeding with BCE slv inbox tx request and schedule");
}
}
else
{
Expand All @@ -337,6 +343,13 @@ void task_dcom_tx_slv_inbox( task_t *i_self)
// Only proceed if the BCE request state checked out
if (l_proceed_with_request_and_schedule)
{
if(L_bce_not_ready_count >= DCOM_TRACE_NOT_IDLE_AFTER_CONSEC_TIMES) // previously not idle
{
TRAC_INFO("BCE slv inbox tx request idle and complete after %d times", L_bce_not_ready_count);
}

L_bce_not_ready_count = 0;

// Set up inboxes copy request
l_ssxrc = bce_request_create(
&G_slv_inbox_tx_pba_request, // Block copy object
Expand Down Expand Up @@ -389,6 +402,12 @@ void task_dcom_tx_slv_inbox( task_t *i_self)
break;
}
}
else
{
L_bce_not_ready_count++;
INCREMENT_ERR_HISTORY(ERR_DCOM_TX_SLV_INBOX);
}

// Moved the break statement here in case we decide not to
// schedule the BCE request.
break;
Expand All @@ -402,6 +421,8 @@ void task_dcom_tx_slv_inbox( task_t *i_self)
}
else
{
INCREMENT_ERR_HISTORY(ERR_DCOM_APSS_COMPLETE_TIMEOUT);

//Failure occurred, step up the FAIL_COUNT
APSS_FAIL();

Expand Down

0 comments on commit 67f48d4

Please sign in to comment.