summaryrefslogtreecommitdiffstats
path: root/src/occ_405/proc
diff options
context:
space:
mode:
authormbroyles <mbroyles@us.ibm.com>2018-02-08 16:47:04 -0600
committerChristopher J. Cain <cjcain@us.ibm.com>2018-02-16 15:33:29 -0500
commit919b78927d26c079ac3234128e09c548920f3487 (patch)
tree01bee21ecf054f12029392122073af008d28a413 /src/occ_405/proc
parentfca494dbdcf944718a577bfe0e3c6c01aabb1a69 (diff)
downloadtalos-occ-919b78927d26c079ac3234128e09c548920f3487.tar.gz
talos-occ-919b78927d26c079ac3234128e09c548920f3487.zip
Characterization state meltbox support
Prevent temperature timeout errors during state transition Misc state characterization and observation state change fixes Change-Id: Ideeaab96689b145ed960aef5743b8c3947e4ffeb Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53674 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Diffstat (limited to 'src/occ_405/proc')
-rwxr-xr-xsrc/occ_405/proc/proc_data_control.c67
-rwxr-xr-xsrc/occ_405/proc/proc_pstate.c5
2 files changed, 15 insertions, 57 deletions
diff --git a/src/occ_405/proc/proc_data_control.c b/src/occ_405/proc/proc_data_control.c
index 2b793d0..df79096 100755
--- a/src/occ_405/proc/proc_data_control.c
+++ b/src/occ_405/proc/proc_data_control.c
@@ -54,13 +54,11 @@ extern GpeRequest G_pmcr_set_req;
// this must give the PGPE at least 1ms, doubling that time to 2ms to be safe
#define SUPPRESS_PGPE_ERR_WAIT_TICKS 4 // 2ms
-extern bool G_state_transition_occuring; // A state transition is currently going on?
-
+// A state transition is currently going on?
+extern volatile bool G_state_transition_occuring;
+// Need to send Pstates even if they didn't "change"?
+extern volatile bool G_set_pStates;
extern uint16_t G_allow_trace_flags;
-// a global flag used by task_core_data_control() to indicate
-// that the OCC is ready to transition to observation state
-// (after initiatibg a clip update IPC task if needed)
-bool G_active_to_observation_ready = false;
// Only allow pstates after mode change.
bool G_allowPstates = FALSE;
@@ -77,7 +75,6 @@ void task_core_data_control( task_t * i_task )
errlHndl_t err = NULL; //Error handler
static bool L_trace_logged = false; // trace logging to avoid unnecessarily repeating logs
static bool L_current_timeout_recorded = FALSE;
- Pstate l_pstate;
static uint64_t L_last = 0xFFFFFFFFFFFFFFFF;
static uint64_t L_ignore_wait_count = 0; // number of consecutive ticks IPC task failed
bool l_check_failure = false;
@@ -91,54 +88,13 @@ void task_core_data_control( task_t * i_task )
// with the task_core_data_control IPC tasks.
if(G_state_transition_occuring)
{
+ L_ignore_wait_count = 0;
+ L_current_timeout_recorded = FALSE;
if(L_trace_logged == false)
{
TRAC_INFO("task_core_data_control: Pstate Control stopped because a state transition started.");
L_trace_logged = true;
}
-
- // Only Transitioning to Observation state necessitates clip update
- // (if the last clip update was higher than legacy turbo).
- if ((G_occ_master_state == OCC_STATE_OBSERVATION) &&
- !G_active_to_observation_ready)
- {
- // confirm that the last clip update IPC successfully completed on PGPE (with no errors)
- if( async_request_is_idle(&G_clip_update_req.request) && //clip_update/set_clip_ranges completed
- (G_clip_update_parms.msg_cb.rc == PGPE_RC_SUCCESS) ) // with no errors
- {
- uint8_t quad = 0;
- Pstate pclip = 0xff; // Initialize pclip to 0xff (lowest possible frequency)
-
- // Only if last clip update sent to PGPE is larger than legacy turbo,
- // send new clips with legacy turbo values, otherwise, no action needed.
- for (quad = 0; quad < MAXIMUM_QUADS; quad++)
- {
- if(G_clip_update_parms.ps_val_clip_max[quad] < pclip)
- {
- // minimum pclip value corresponds to pstate of maximum frequency
- pclip = G_clip_update_parms.ps_val_clip_max[quad];
- }
- }
- l_pstate = proc_freq2pstate(G_sysConfigData.sys_mode_freq.table[OCC_MODE_TURBO]);
- // pclip of highest quad frequency corresponds to a frequency higher than legacy turbo
- if(pclip < l_pstate)
- {
- if( G_allow_trace_flags & ALLOW_CLIP_TRACE )
- {
- TRAC_INFO("task_core_data_control: updating clip max to pstate 0x%02X (from 0x%02X)", l_pstate, pclip);
- }
- // set the all quads to same pstate
- memset(G_desired_pstate, l_pstate, MAXIMUM_QUADS);
- //call PGPE IPC function to update the clips
- pgpe_clip_update();
- }
-
- //Whether clips have been lowered from frequencies higher than legacy turbo
- //frequency, or already lower than turbo frequency, OCC is now ready to
- //transition to Observation state.
- G_active_to_observation_ready = true;
- }
- }
} // if in state transition
else
{
@@ -193,9 +149,12 @@ void task_core_data_control( task_t * i_task )
G_pmcr_set_parms.pmcr[quad] = ((uint64_t) G_desired_pstate[quad] << 48) | 1;
}
- // Only send pstates if they changed
- if (L_last != pstateList)
+ // Only send pstates if they changed or first time after going active from char state
+ // in characterization state the user is writing the PMCR, need to make sure we write
+ // it back to desired Pstates
+ if( (L_last != pstateList) || (G_set_pStates) )
{
+ G_set_pStates = FALSE;
L_last = pstateList;
if( G_allow_trace_flags & ALLOW_PMCR_TRACE )
@@ -237,8 +196,8 @@ void task_core_data_control( task_t * i_task )
{
if(!ignore_pgpe_error())
{
- TRAC_ERR("task_core_data_control: pstate update IPC task did not complete successfully, idle?[%d] rc[%08X]",
- l_request_is_idle, l_request_rc);
+ TRAC_ERR("task_core_data_control: pstate[0x%02X] update IPC task did not complete successfully, idle?[%d] rc[%08X]",
+ G_desired_pstate[0], l_request_is_idle, l_request_rc);
err = createErrl(
RTLS_TASK_CORE_DATA_CONTROL_MOD, //ModId
diff --git a/src/occ_405/proc/proc_pstate.c b/src/occ_405/proc/proc_pstate.c
index f78eb41..5f0cad7 100755
--- a/src/occ_405/proc/proc_pstate.c
+++ b/src/occ_405/proc/proc_pstate.c
@@ -61,11 +61,10 @@ uint8_t G_desired_pstate[MAXIMUM_QUADS];
// initialized to PSTATES_DISABLED, turns to PSTATES_ENABLED only after
// the PGPE IPC that enable pstates completes successfully. While the IPC
// task is still running, this variable be set to PSTATES_IN_TRANSITION
-pstateStatus G_proc_pstate_status = PSTATES_DISABLED;
-
+volatile pstateStatus G_proc_pstate_status = PSTATES_DISABLED;
// A Global parameter indicating the owner of the PMCR.
-PMCR_OWNER G_proc_pmcr_owner = PMCR_OWNER_HOST;
+volatile PMCR_OWNER G_proc_pmcr_owner = PMCR_OWNER_HOST;
// OPAL Dynamic data, updated whenever any OCC G_opal_table.dynamic parameter change
// Since this is happening multiple times need to keep track of it being scheduled
OpenPOWER on IntegriCloud