summaryrefslogtreecommitdiffstats
path: root/src/occ_405/proc
diff options
context:
space:
mode:
authorWael El-Essawy <welessa@us.ibm.com>2017-01-27 11:01:21 -0600
committerWael El-Essawy <welessa@us.ibm.com>2017-02-22 12:01:54 -0500
commitcfdf01a5cd0d5651a5930cc6ff014fade184c90f (patch)
tree49ae2529e1584732e5a9c616e11107bd39e275d4 /src/occ_405/proc
parent3b610c244fb402e50768b8d67b55a91f665a53d3 (diff)
downloadtalos-occ-cfdf01a5cd0d5651a5930cc6ff014fade184c90f.tar.gz
talos-occ-cfdf01a5cd0d5651a5930cc6ff014fade184c90f.zip
Characterization state, new state transitions and Active to Observation state
Support for new characterization state changes used by manufacturing. Observation state and new characterization state. Details in version 0.10 OCC Interface Specifications. Change-Id: I2ff0fc9327ad75e54c0a47cf42946e58f387522b RTC: 163268 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35517 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: Wael El-Essawy <welessa@us.ibm.com>
Diffstat (limited to 'src/occ_405/proc')
-rwxr-xr-xsrc/occ_405/proc/proc_data_control.c243
1 files changed, 152 insertions, 91 deletions
diff --git a/src/occ_405/proc/proc_data_control.c b/src/occ_405/proc/proc_data_control.c
index f10ce43..0e902a8 100755
--- a/src/occ_405/proc/proc_data_control.c
+++ b/src/occ_405/proc/proc_data_control.c
@@ -39,6 +39,7 @@
#include "p9_pstates_common.h"
#include "pgpe_interface.h"
#include "rtls_service_codes.h"
+#include "proc_pstate.h"
// The the GPE parameter fields for PGPE IPC calls.
extern GPE_BUFFER(ipcmsg_clip_update_t* G_clip_update_parms_ptr);
@@ -47,6 +48,13 @@ extern GPE_BUFFER(ipcmsg_set_pmcr_t* G_pmcr_set_parms_ptr);
extern GpeRequest G_clip_update_req;
extern GpeRequest G_pmcr_set_req;
+extern bool G_state_transition_occuring; // A state transition is currently going on?
+
+// 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;
+
// create gpe request for GPE job. The initialization will be done one time
// during gpe request create.
GpeRequest G_core_data_control_req;
@@ -70,112 +78,165 @@ GPE_BUFFER(PstatesClips* G_core_data_control_gpewrite_ptr) = { &G_quads_data_con
// End Function Specification
void task_core_data_control( task_t * i_task )
{
- errlHndl_t err = NULL; //Error handler
- PstatesClips* l_temp = NULL;
+ errlHndl_t err = NULL; //Error handler
+ PstatesClips* l_temp = NULL;
+ static bool L_trace_logged = false; // trace logging to avoid unnecessarily repeatig logs
+
/////////////////////////////////////////////////////////////////
- // perform Pstate/clip control if previous IPC call completed successfully
- // if not idle, ignore cycle
- // if an error was returned, log an error, and request reset
- if(G_sysConfigData.system_type.kvm) // OPAL system
+ // Once a state transition process starts, task data control
+ // stops updating the PMCR/CLIPS updates, this way, the state
+ // transition protocol can set the clips without colliding
+ // with the task_core_data_control IPC tasks.
+ if(G_state_transition_occuring)
{
- // confirm that the clip update IPC from last cycle
- // has successfully completed on PGPE (with no errors)
- if( async_request_is_idle(&G_clip_update_req.request) && //clip_update/widen_clip_ranges completed
- (G_clip_update_parms_ptr->msg_cb.rc == PGPE_RC_SUCCESS) ) // with no errors
+ if(L_trace_logged == false)
{
-
- //The previous OPAL PGPE request succeeded:
-
- //1) swap gpewrite ptr with the occwrite ptr (double buffering).
- l_temp = G_core_data_control_occwrite_ptr;
- G_core_data_control_occwrite_ptr = G_core_data_control_gpewrite_ptr;
- G_core_data_control_gpewrite_ptr = l_temp;
-
- //2) Set clip values from gpewrite's quad clips data-structure
- G_clip_update_parms_ptr = &G_core_data_control_gpewrite_ptr->clips;
-
- //call PGPE IPC function to update the clips
- pgpe_clip_update();
+ TRAC_INFO("task_core_data_control: Pstate Control stopped because a state transition started.");
+ L_trace_logged = true;
}
- else if(G_clip_update_parms_ptr->msg_cb.rc != PGPE_RC_SUCCESS)
+
+ // 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)
{
- // an earlier clip update IPC call has not completed, trace and log an error
- TRAC_ERR("task_core_data_control: clip update IPC task returned an error, %d",
- G_clip_update_parms_ptr->msg_cb.rc);
-
- /*
- * @errortype
- * @moduleid RTLS_TASK_CORE_DATA_CONTROL_MOD
- * @reasoncode PGPE_FAILURE
- * @userdata1 rc
- * @userdata2 clip update task idle?
- * @userdata4 ERC_PGPE_CLIP_UNSUCCESSFULL
- * @devdesc pgpe clip update returned an error
- */
- err = createErrl(
- RTLS_TASK_CORE_DATA_CONTROL_MOD, //ModId
- PGPE_FAILURE, //Reasoncode
- ERC_PGPE_CLIP_UNSUCCESSFULL, //Extended reason code
- ERRL_SEV_PREDICTIVE, //Severity
- NULL, //Trace Buf
- DEFAULT_TRACE_SIZE, //Trace Size
- G_clip_update_parms_ptr->msg_cb.rc, //Userdata1
- async_request_is_idle(&G_clip_update_req.request) //Userdata2
- );
+ // 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/widen_clip_ranges completed
+ (G_clip_update_parms_ptr->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 < MAX_QUADS; quad++)
+ {
+ if(G_clip_update_parms_ptr->ps_val_clip_max[quad] < pclip)
+ {
+ // minimum pclip value corresponds to pstate of maximum frequency
+ pclip = G_clip_update_parms_ptr->ps_val_clip_max[quad];
+ }
+ }
+ // pclip of highest quad frequency corresponds to a frequency higher than legacy turbo
+ if(pclip < proc_freq2pstate(G_sysConfigData.sys_mode_freq.table[OCC_MODE_TURBO]))
+ {
+ pgpe_widen_clip_ranges(OCC_STATE_OBSERVATION);
+ }
+
+ //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;
+ }
}
}
else
{
- // NON OPAL System, OCC owns PMCR:
- if( async_request_is_idle(&G_pmcr_set_req.request) && // PMCR IPC from last TICK completed
- (G_pmcr_set_parms_ptr->msg_cb.rc == PGPE_RC_SUCCESS) ) // with no errors
- {
- //The previous Non-OPAL PGPE request succeeded:
-
- //1) swap gpewrite ptr with the occwrite ptr (double buffering).
- l_temp = G_core_data_control_occwrite_ptr;
- G_core_data_control_occwrite_ptr = G_core_data_control_gpewrite_ptr;
- G_core_data_control_gpewrite_ptr = l_temp;
+ L_trace_logged = false;
- //2) Set Pstate values from gpewrite's quad pstates data-structure
- G_pmcr_set_parms_ptr = &G_core_data_control_gpewrite_ptr->pstates;
-
- //call PGPE IPC function to update Pstates
- pgpe_pmcr_set();
+ // perform Pstate/clip control if previous IPC call completed successfully
+ // if not idle, ignore cycle
+ // if an error was returned, log an error, and request reset
+ if(G_sysConfigData.system_type.kvm) // OPAL system
+ {
+ // confirm that the clip update IPC from last cycle
+ // has successfully completed on PGPE (with no errors)
+ if( async_request_is_idle(&G_clip_update_req.request) && //clip_update/widen_clip_ranges completed
+ (G_clip_update_parms_ptr->msg_cb.rc == PGPE_RC_SUCCESS) ) // with no errors
+ {
+ //The previous OPAL PGPE request succeeded:
+
+ //1) swap gpewrite ptr with the occwrite ptr (double buffering).
+ l_temp = G_core_data_control_occwrite_ptr;
+ G_core_data_control_occwrite_ptr = G_core_data_control_gpewrite_ptr;
+ G_core_data_control_gpewrite_ptr = l_temp;
+
+ //2) Set clip values from gpewrite's quad clips data-structure
+ G_clip_update_parms_ptr = &G_core_data_control_gpewrite_ptr->clips;
+
+ //call PGPE IPC function to update the clips
+ pgpe_clip_update();
+ }
+ else if(G_clip_update_parms_ptr->msg_cb.rc != PGPE_RC_SUCCESS)
+ {
+ // an earlier clip update IPC call has not completed, trace and log an error
+ TRAC_ERR("task_core_data_control: clip update IPC task returned an error, %d",
+ G_clip_update_parms_ptr->msg_cb.rc);
+
+ /*
+ * @errortype
+ * @moduleid RTLS_TASK_CORE_DATA_CONTROL_MOD
+ * @reasoncode PGPE_FAILURE
+ * @userdata1 rc
+ * @userdata2 clip update task idle?
+ * @userdata4 ERC_PGPE_CLIP_UNSUCCESSFULL
+ * @devdesc pgpe clip update returned an error
+ */
+ err = createErrl(
+ RTLS_TASK_CORE_DATA_CONTROL_MOD, //ModId
+ PGPE_FAILURE, //Reasoncode
+ ERC_PGPE_CLIP_UNSUCCESSFULL, //Extended reason code
+ ERRL_SEV_PREDICTIVE, //Severity
+ NULL, //Trace Buf
+ DEFAULT_TRACE_SIZE, //Trace Size
+ G_clip_update_parms_ptr->msg_cb.rc, //Userdata1
+ async_request_is_idle(&G_clip_update_req.request) //Userdata2
+ );
+ }
}
- else if(G_pmcr_set_parms_ptr->msg_cb.rc != PGPE_RC_SUCCESS)
+ else
{
- // an earlier clip update IPC call has not completed, trace and log an error
- TRAC_ERR("task_core_data_control: pstate update IPC task returned an error, %d",
- G_pmcr_set_parms_ptr->msg_cb.rc);
-
- /*
- * @errortype
- * @moduleid RTLS_TASK_CORE_DATA_CONTROL_MOD
- * @reasoncode PGPE_FAILURE
- * @userdata1 rc
- * @userdata2 pmcr set task idle?
- * @userdata4 ERC_PGPE_PMCR_UNSUCCESSFULL
- * @devdesc pgpe PMCR set returned an error
- */
- err = createErrl(
- RTLS_TASK_CORE_DATA_CONTROL_MOD, //ModId
- PGPE_FAILURE, //Reasoncode
- ERC_PGPE_PMCR_UNSUCCESSFULL, //Extended reason code
- ERRL_SEV_PREDICTIVE, //Severity
- NULL, //Trace Buf
- DEFAULT_TRACE_SIZE, //Trace Size
- G_pmcr_set_parms_ptr->msg_cb.rc, //Userdata1
- async_request_is_idle(&G_pmcr_set_req.request) //Userdata2
- );
+ // NON OPAL System, OCC owns PMCR:
+ if( async_request_is_idle(&G_pmcr_set_req.request) && // PMCR IPC from last TICK completed
+ (G_pmcr_set_parms_ptr->msg_cb.rc == PGPE_RC_SUCCESS) ) // with no errors
+ {
+ //The previous Non-OPAL PGPE request succeeded:
+
+ //1) swap gpewrite ptr with the occwrite ptr (double buffering).
+ l_temp = G_core_data_control_occwrite_ptr;
+ G_core_data_control_occwrite_ptr = G_core_data_control_gpewrite_ptr;
+ G_core_data_control_gpewrite_ptr = l_temp;
+
+ //2) Set Pstate values from gpewrite's quad pstates data-structure
+ G_pmcr_set_parms_ptr = &G_core_data_control_gpewrite_ptr->pstates;
+
+ //call PGPE IPC function to update Pstates
+ pgpe_pmcr_set();
+ }
+ else if(G_pmcr_set_parms_ptr->msg_cb.rc != PGPE_RC_SUCCESS)
+ {
+ // an earlier clip update IPC call has not completed, trace and log an error
+ TRAC_ERR("task_core_data_control: pstate update IPC task returned an error, %d",
+ G_pmcr_set_parms_ptr->msg_cb.rc);
+
+ /*
+ * @errortype
+ * @moduleid RTLS_TASK_CORE_DATA_CONTROL_MOD
+ * @reasoncode PGPE_FAILURE
+ * @userdata1 rc
+ * @userdata2 pmcr set task idle?
+ * @userdata4 ERC_PGPE_PMCR_UNSUCCESSFULL
+ * @devdesc pgpe PMCR set returned an error
+ */
+ err = createErrl(
+ RTLS_TASK_CORE_DATA_CONTROL_MOD, //ModId
+ PGPE_FAILURE, //Reasoncode
+ ERC_PGPE_PMCR_UNSUCCESSFULL, //Extended reason code
+ ERRL_SEV_PREDICTIVE, //Severity
+ NULL, //Trace Buf
+ DEFAULT_TRACE_SIZE, //Trace Size
+ G_pmcr_set_parms_ptr->msg_cb.rc, //Userdata1
+ async_request_is_idle(&G_pmcr_set_req.request) //Userdata2
+ );
+ }
}
- }
- if(err)
- {
- // commit error log
- REQUEST_RESET(err);
+ if(err)
+ {
+ // commit error log
+ REQUEST_RESET(err);
+ }
}
return;
OpenPOWER on IntegriCloud