diff options
author | mbroyles <mbroyles@us.ibm.com> | 2015-08-09 16:01:09 -0500 |
---|---|---|
committer | William A. Bryan <wilbryan@us.ibm.com> | 2015-08-10 11:48:42 -0500 |
commit | d4b74d20664271d6736008d87591a5fcbf815ded (patch) | |
tree | ee3c8b2bffaf3cfb127234a07d8f90e0bffa7631 /src/occ_405/pss/apss.c | |
parent | 415a7a297bcd313516be30ae88277379f3377cc9 (diff) | |
download | talos-occ-d4b74d20664271d6736008d87591a5fcbf815ded.tar.gz talos-occ-d4b74d20664271d6736008d87591a5fcbf815ded.zip |
Start GPE0 and schedule APSS read tasks
Change-Id: I045a6b32bbbb4944ba766cde17f0ce9645f879e6
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19693
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Tested-by: William A. Bryan <wilbryan@us.ibm.com>
Tested-by: FSP CI Jenkins
Diffstat (limited to 'src/occ_405/pss/apss.c')
-rwxr-xr-x | src/occ_405/pss/apss.c | 83 |
1 files changed, 35 insertions, 48 deletions
diff --git a/src/occ_405/pss/apss.c b/src/occ_405/pss/apss.c index d530b7e..00d67ad 100755 --- a/src/occ_405/pss/apss.c +++ b/src/occ_405/pss/apss.c @@ -63,10 +63,9 @@ GPE_BUFFER(apss_start_args_t G_gpe_start_pwr_meas_read_args); GPE_BUFFER(apss_continue_args_t G_gpe_continue_pwr_meas_read_args); GPE_BUFFER(apss_complete_args_t G_gpe_complete_pwr_meas_read_args); -// TEMP -- NO MORE PORE -//PoreEntryPoint GPE_apss_start_pwr_meas_read; -//PoreEntryPoint GPE_apss_continue_pwr_meas_read; -//PoreEntryPoint GPE_apss_complete_pwr_meas_read; +GpeRequest G_meas_start_request; +GpeRequest G_meas_cont_request; +GpeRequest G_meas_complete_request; // Up / down counter for redundant apss failures uint32_t G_backup_fail_count = 0; @@ -198,9 +197,7 @@ void do_apss_recovery(void) */ // Special error handling on OCC backup. Keep an up/down counter of // fail/success and log predictive error when we reach the limit. -// if(G_occ_role == OCC_SLAVE) -// TEMP -- IN PHASE 1 WE ARE ALWAYS MASTER - if (FALSE) + if(G_occ_role == OCC_SLAVE) { if(G_backup_fail_count < MAX_BACKUP_FAILURES) { @@ -297,8 +294,7 @@ void do_apss_recovery(void) // Note: The complete request must be global, since it must stick around until after the // GPE program has completed (in order to do the callback). -// TEMP -- NO MORE PORE -//PoreFlex G_meas_start_request; + // Function Specification // // Name: task_apss_start_pwr_meas @@ -314,14 +310,13 @@ void task_apss_start_pwr_meas(struct task *i_self) int l_rc = 0; static bool L_scheduled = FALSE; static bool L_idle_traced = FALSE; - static bool L_ffdc_collected = FALSE; +// static bool L_ffdc_collected = FALSE; // Create/schedule GPE_start_pwr_meas_read (non-blocking) APSS_DBG("GPE_start_pwr_meas_read started\n"); do { -/* TEMP -- NO MORE PORE if (!async_request_is_idle(&G_meas_start_request.request)) { if (!L_idle_traced) @@ -331,7 +326,7 @@ void task_apss_start_pwr_meas(struct task *i_self) } break; } -*/ + // Check if we need to try recovering the apss if(G_apss_recovery_requested) { @@ -342,10 +337,11 @@ void task_apss_start_pwr_meas(struct task *i_self) if (L_scheduled) { -// TEMP -- UNCOMMENT ONCE G_meas_start_request is defined again -/* if ((ASYNC_REQUEST_STATE_COMPLETE != G_meas_start_request.request.completion_state) || + + if ((ASYNC_REQUEST_STATE_COMPLETE != G_meas_start_request.request.completion_state) || (0 != G_gpe_start_pwr_meas_read_args.error.error)) { +/* TEMP No error handling //error should only be non-zero in the case where the GPE timed out waiting for //the APSS master to complete the last operation. Just keep retrying until //DCOM resets us due to not having valid power data. @@ -359,6 +355,7 @@ void task_apss_start_pwr_meas(struct task *i_self) // Collect FFDC and log error once. if (!L_ffdc_collected) { + errlHndl_t l_err = NULL; /* @@ -386,12 +383,12 @@ void task_apss_start_pwr_meas(struct task *i_self) // Commit Error commitErrl(&l_err); - // Set to true so that we don't log this error again. L_ffdc_collected = TRUE; } - } */ + } + } // Clear these out prior to starting the GPE (GPE only sets them) @@ -399,8 +396,7 @@ void task_apss_start_pwr_meas(struct task *i_self) G_gpe_start_pwr_meas_read_args.error.ffdc = 0; // Submit the next request -// TEMP -- NO MORE PORE -// l_rc = pore_flex_schedule(&G_meas_start_request); + l_rc = gpe_request_schedule(&G_meas_start_request); if (0 != l_rc) { errlHndl_t l_err = NULL; @@ -449,8 +445,7 @@ void task_apss_start_pwr_meas(struct task *i_self) // Note: The complete request must be global, since it must stick around until after the // GPE program has completed (in order to do the callback). -// TEMP -- NO MORE PORE -//PoreFlex G_meas_cont_request; + // Function Specification // // Name: task_apss_continue_pwr_meas @@ -474,7 +469,6 @@ void task_apss_continue_pwr_meas(struct task *i_self) do { -/* TEMP -- NO MORE PORE if (!async_request_is_idle(&G_meas_cont_request.request)) { if (!L_idle_traced) @@ -484,7 +478,7 @@ void task_apss_continue_pwr_meas(struct task *i_self) } break; } -*/ + //Don't run anything if apss recovery is in progress if(G_apss_recovery_requested) { @@ -493,7 +487,6 @@ void task_apss_continue_pwr_meas(struct task *i_self) if (L_scheduled) { -/* TEMP -- UNCOMMENT ONCE G_meas_cont_request IS DEFINED AGAIN if ((ASYNC_REQUEST_STATE_COMPLETE != G_meas_cont_request.request.completion_state) || (0 != G_gpe_continue_pwr_meas_read_args.error.error)) { @@ -511,6 +504,7 @@ void task_apss_continue_pwr_meas(struct task *i_self) // Collect FFDC and log error once. if (!L_ffdc_collected) { +/* TEMP no error logging errlHndl_t l_err = NULL; /* @@ -539,12 +533,11 @@ void task_apss_continue_pwr_meas(struct task *i_self) // Commit Error commitErrl(&l_err); - +*/ // Set to true so that we don't log this error again. L_ffdc_collected = TRUE; } } -*/ } // Clear these out prior to starting the GPE (GPE only sets them) @@ -552,10 +545,10 @@ void task_apss_continue_pwr_meas(struct task *i_self) G_gpe_continue_pwr_meas_read_args.error.ffdc = 0; // Submit the next request -/* TEMP -- UNCOMMENT ONCE G_meas_cont_request IS DEFINED AGAIN - l_rc = pore_flex_schedule(&G_meas_cont_request); + l_rc = gpe_request_schedule(&G_meas_cont_request); if (0 != l_rc) { +/* TEMP no error logging errlHndl_t l_err = NULL; TRAC_ERR("task_apss_cont_pwr_meas: schedule failed w/rc=0x%08X (%d us)", l_rc, @@ -581,12 +574,13 @@ void task_apss_continue_pwr_meas(struct task *i_self) // Request reset since this should never happen. REQUEST_RESET(l_err); +*/ L_scheduled = FALSE; break; } L_scheduled = TRUE; -*/ + }while (0); APSS_DBG("task_apss_continue_pwr_meas: finished w/rc=0x%08X\n", G_gpe_continue_pwr_meas_read_args.error.rc); @@ -634,11 +628,8 @@ void reformat_meas_data() } // Don't do the copy unless this is the master OCC -// if(G_occ_role == OCC_MASTER) - // TEMP -- IN PHASE 1 WE ARE ALWAYS MASTER - if (TRUE) + if(G_occ_role == OCC_MASTER) { - // Fail every 16 seconds APSS_DBG("Populate meas data:\n"); @@ -673,8 +664,6 @@ void reformat_meas_data() // Note: The complete request must be global, since it must stick around until after the // GPE program has completed (in order to do the callback). -// TEMP -- NO MORE PORE -//PoreFlex G_meas_complete_request; // Function Specification // @@ -691,15 +680,13 @@ void task_apss_complete_pwr_meas(struct task *i_self) int l_rc = 0; static bool L_scheduled = FALSE; static bool L_idle_traced = FALSE; - static bool L_ffdc_collected = FALSE; +// static bool L_ffdc_collected = FALSE; // Create/schedule GPE_apss_complete_pwr_meas_read (non-blocking) APSS_DBG("Calling task_apss_complete_pwr_meas.\n"); do { -// TEMP -- UNCOMMENT ONCE G_meas_complete_request IS DEFINED AGAIN -/* if (!async_request_is_idle(&G_meas_complete_request.request)) { if (!L_idle_traced) @@ -709,7 +696,6 @@ void task_apss_complete_pwr_meas(struct task *i_self) } break; } -*/ if(G_apss_recovery_requested) { // Allow apss measurement to proceed on next tick @@ -720,11 +706,10 @@ void task_apss_complete_pwr_meas(struct task *i_self) if (L_scheduled) { -// TEMP -- UNCOMMENT ONCE G_meas_complete_request IS DEFINED AGAIN -/* if ((ASYNC_REQUEST_STATE_COMPLETE != G_meas_complete_request.request.completion_state) || (0 != G_gpe_complete_pwr_meas_read_args.error.error)) { +/* TEMP no error logging // Error should only be non-zero in the case where the GPE timed out waiting for // the APSS master to complete the last operation. Just keep retrying until // DCOM resets us due to not having valid power data. @@ -766,12 +751,12 @@ void task_apss_complete_pwr_meas(struct task *i_self) // Commit Error commitErrl(&l_err); - // Set to true so that we don't log this error again. L_ffdc_collected = TRUE; } - } */ + + } } // Clear these out prior to starting the GPE (GPE only sets them) @@ -779,16 +764,15 @@ void task_apss_complete_pwr_meas(struct task *i_self) G_gpe_complete_pwr_meas_read_args.error.ffdc = 0; // Submit the next request -// TEMP -- UNCOMMENT ONCE G_meas_complete_request IS DEFINED AGAIN -/* - l_rc = pore_flex_schedule(&G_meas_complete_request); + + l_rc = gpe_request_schedule(&G_meas_complete_request); if (0 != l_rc) { + errlHndl_t l_err = NULL; TRAC_ERR("task_apss_complete_pwr_meas: schedule failed w/rc=0x%08X (%d us)", l_rc, (int) ((ssx_timebase_get())/(SSX_TIMEBASE_FREQUENCY_HZ/1000000))); - /* * @errortype * @moduleid PSS_MID_APSS_COMPLETE_MEAS @@ -797,7 +781,10 @@ void task_apss_complete_pwr_meas(struct task *i_self) * @userdata2 0 * @userdata4 ERC_APSS_SCHEDULE_FAILURE * @devdesc task_apss_complete_pwr_meas schedule failed - */ /* + */ + +/* TEMP no error logging + l_err = createErrl(PSS_MID_APSS_COMPLETE_MEAS, SSX_GENERIC_FAILURE, ERC_APSS_SCHEDULE_FAILURE, @@ -809,10 +796,10 @@ void task_apss_complete_pwr_meas(struct task *i_self) // Request reset since this should never happen. REQUEST_RESET(l_err); +*/ L_scheduled = FALSE; break; } -*/ L_scheduled = TRUE; |