5
5
/* */
6
6
/* OpenPOWER HostBoot Project */
7
7
/* */
8
- /* Contributors Listed Below - COPYRIGHT 2014,2018 */
8
+ /* Contributors Listed Below - COPYRIGHT 2014,2019 */
9
9
/* [+] International Business Machines Corp. */
10
10
/* */
11
11
/* */
@@ -109,7 +109,6 @@ namespace HTMGT
109
109
110
110
TMGT_BIN ("OCC ELOG" , l_occElog , 256 );
111
111
112
-
113
112
// Get user details section
114
113
const occErrlUsrDtls_t * l_usrDtls_ptr = (occErrlUsrDtls_t * )
115
114
((uint8_t * )l_occElog + sizeof (occErrlEntry_t ));
@@ -118,6 +117,13 @@ namespace HTMGT
118
117
ERRORLOG ::errlSeverity_t severity =
119
118
ERRORLOG ::ERRL_SEV_INFORMATIONAL ;
120
119
120
+ if (l_occSrc == 0x2A01 )
121
+ {
122
+ // 2A01 is Periodic OCC Telemetry / Call Home data
123
+ TMGT_INF ("OCC is reporting Periodic Telemetry Data (0x2A01)"
124
+ " - NOT AN ERROR" );
125
+ }
126
+
121
127
// Translate Severity
122
128
const uint8_t l_occSeverity = l_occElog -> severity ;
123
129
if (l_occSeverity < OCC_SEV_ACTION_XLATE_SIZE )
@@ -132,42 +138,12 @@ namespace HTMGT
132
138
}
133
139
134
140
// Process Actions
135
- bool l_occReset = false;
136
- elogProcessActions (l_occElog -> actions , l_occReset , severity );
137
-
138
-
139
-
140
- // Need to add WOF reason code to OCC object regardless of
141
- // whether WOF resets are disabled.
142
- if ( l_occElog -> actions & TMGT_ERRL_ACTIONS_WOF_RESET_REQUIRED )
143
- {
144
- iv_wofResetReasons |= l_usrDtls_ptr -> userData1 ;
145
- TMGT_ERR ("WOF Reset Reasons for OCC%d = 0x%08x" ,
146
- iv_instance ,
147
- iv_wofResetReasons );
148
-
149
- }
150
-
151
- // Check if we need a WOF requested reset
152
- if (iv_needsWofReset == true)
153
- {
154
- TMGT_ERR ("WOF Reset detected! SRC = 0x%X" ,
155
- l_occSrc );
156
-
157
- // We compare against one less than the threshold because
158
- // the WOF reset count doesn't get incremented until resetPrep
159
- if ( iv_wofResetCount < (WOF_RESET_COUNT_THRESHOLD - 1 ) )
160
- {
161
- // Not at WOF reset threshold yet. Set sev to INFO
162
- severity = ERRORLOG ::ERRL_SEV_INFORMATIONAL ;
163
- }
164
- }
165
-
166
- if (l_occReset == true)
167
- {
168
- iv_needsReset = true;
169
- OccManager ::updateSafeModeReason (l_occSrc , iv_instance );
170
- }
141
+ bool l_call_home_event = false;
142
+ elogProcessActions (l_occElog -> actions ,
143
+ l_occSrc ,
144
+ l_usrDtls_ptr -> userData1 ,
145
+ severity ,
146
+ l_call_home_event );
171
147
172
148
// Create OCC error log
173
149
// NOTE: word 4 (used by extended reason code) to save off OCC
@@ -185,6 +161,13 @@ namespace HTMGT
185
161
l_occElog -> extendedRC , // extended reason code
186
162
severity );
187
163
164
+ if (l_call_home_event )
165
+ {
166
+ // Force info log to the BMC.
167
+ // No HW Callouts (SELs) will be created for this error
168
+ l_errlHndl -> setEselCallhomeInfoEvent (true);
169
+ }
170
+
188
171
// Add callout information
189
172
const uint8_t l_max_callouts = l_occElog -> maxCallouts ;
190
173
bool l_bad_fru_data = false;
@@ -295,16 +278,11 @@ namespace HTMGT
295
278
"HALT_ON_SRC is set. Resets will be disabled" ,
296
279
iv_instance , l_occSrc );
297
280
set_int_flags (get_int_flags () | FLAG_RESET_DISABLED );
281
+ // Force unrecoverable elog
282
+ l_errlHndl -> setSev (ERRORLOG ::ERRL_SEV_UNRECOVERABLE );
298
283
}
299
284
}
300
285
301
- // Process force error log to be sent to BMC.
302
- if ( (l_occElog -> actions & TMGT_ERRL_ACTIONS_FORCE_ERROR_POSTED ) ||
303
- (l_occSrc == (OCCC_COMP_ID | 0x01 ) ) ) //GEN_CALLHOME_LOG
304
- {
305
- l_errlHndl -> setEselCallhomeInfoEvent (true);
306
- }
307
-
308
286
#ifdef CONFIG_CONSOLE_OUTPUT_OCC_COMM
309
287
char header [64 ];
310
288
sprintf (header , "OCC%d ELOG: (0x%04X bytes)" , iv_instance , i_length );
@@ -426,57 +404,117 @@ namespace HTMGT
426
404
427
405
} // end Occ::elogAddCallout()
428
406
429
- void Occ ::elogProcessActions (const uint8_t i_actions ,
430
- bool & o_occReset ,
431
- ERRORLOG ::errlSeverity_t & o_errlSeverity )
407
+
408
+ void Occ ::elogProcessActions (const uint8_t i_actions ,
409
+ const uint32_t i_src ,
410
+ uint32_t i_data ,
411
+ ERRORLOG ::errlSeverity_t & io_errlSeverity ,
412
+ bool & o_call_home )
432
413
{
414
+ bool l_occReset = false;
415
+ o_call_home = false;
416
+
433
417
if (i_actions & TMGT_ERRL_ACTIONS_WOF_RESET_REQUIRED )
434
418
{
435
419
iv_failed = false;
436
420
iv_resetReason = OCC_RESET_REASON_WOF_REQUEST ;
437
421
// Check if WOF resets are disabled
438
422
if (int_flags_set (FLAG_WOF_RESET_DISABLED ) == true)
439
423
{
440
- o_occReset = false;
441
424
iv_needsWofReset = false;
442
425
TMGT_INF ("elogProcessActions: OCC%d requested a WOF reset "
443
426
"but WOF resets are DISABLED" ,
444
427
iv_instance );
445
428
}
446
429
else // WOF resets are enabled
447
430
{
448
- o_occReset = true;
431
+ l_occReset = true;
449
432
iv_needsWofReset = true;
450
- TMGT_INF ("elogProcessActions: OCC%d requested a WOF reset" ,
433
+ TMGT_ERR ("elogProcessActions: OCC%d requested a WOF reset" ,
451
434
iv_instance );
435
+
436
+ // We compare against one less than the threshold because the
437
+ // WOF reset count doesn't get incremented until the resetPrep
438
+ if ( iv_wofResetCount < (WOF_RESET_COUNT_THRESHOLD - 1 ) )
439
+ {
440
+ // Not at WOF reset threshold yet. Set sev to INFO
441
+ io_errlSeverity = ERRORLOG ::ERRL_SEV_INFORMATIONAL ;
442
+ }
452
443
}
444
+
445
+ // Need to add WOF reason code to OCC object regardless of
446
+ // whether WOF resets are disabled.
447
+ iv_wofResetReasons |= i_data ;
448
+ TMGT_ERR ("elogProcessActions: WOF Reset Reasons for OCC%d = 0x%08x" ,
449
+ iv_instance , iv_wofResetReasons );
453
450
}
454
451
else
455
452
{
456
453
if (i_actions & TMGT_ERRL_ACTIONS_RESET_REQUIRED )
457
454
{
458
- o_occReset = true;
455
+ l_occReset = true;
459
456
iv_failed = true;
460
457
iv_resetReason = OCC_RESET_REASON_OCC_REQUEST ;
461
458
462
459
TMGT_INF ("elogProcessActions: OCC%d requested reset" ,
463
- iv_instance );
460
+ iv_instance );
461
+
462
+ // If reset will force safe mode, then make error unrecoverable
463
+ if (OCC_RESET_COUNT_THRESHOLD == iv_resetCount )
464
+ {
465
+ if (io_errlSeverity != ERRORLOG ::ERRL_SEV_UNRECOVERABLE )
466
+ {
467
+ // update severity to UNRECOVERABLE
468
+ TMGT_ERR ("elogProcessActions: changing severity to "
469
+ "UNRECOVERABLE (was sev=0x%02X)" ,
470
+ io_errlSeverity );
471
+ io_errlSeverity = ERRORLOG ::ERRL_SEV_UNRECOVERABLE ;
472
+ }
473
+ }
474
+ else if (io_errlSeverity != ERRORLOG ::ERRL_SEV_INFORMATIONAL )
475
+ {
476
+ // update severity to INFO
477
+ TMGT_INF ("elogProcessActions: changing severity to "
478
+ "INFORMATIONAL (was sev=0x%02X)" ,
479
+ io_errlSeverity );
480
+ io_errlSeverity = ERRORLOG ::ERRL_SEV_INFORMATIONAL ;
481
+ // log will be sent to BMC with NO SEL (hardware callouts)
482
+ o_call_home = true;
483
+ }
464
484
}
465
485
466
486
if (i_actions & TMGT_ERRL_ACTIONS_SAFE_MODE_REQUIRED )
467
487
{
468
- o_occReset = true;
488
+ l_occReset = true;
469
489
iv_failed = true;
470
490
iv_resetReason = OCC_RESET_REASON_CRIT_FAILURE ;
471
491
iv_resetCount = OCC_RESET_COUNT_THRESHOLD ;
472
492
473
493
TMGT_INF ("elogProcessActions: OCC%d requested safe mode" ,
474
494
iv_instance );
475
495
TMGT_CONSOLE ("OCC%d requested system enter safe mode" ,
476
- iv_instance );
496
+ iv_instance );
477
497
}
478
498
}
479
499
500
+ // Check if error needs to be forced to the BMC:
501
+ // 1. 2A01 = OCC call home/telemetry data, OR
502
+ // 2. OCC requested force, but error was changed to info by HTMGT
503
+ // (log will be sent to the BMC with NO SEL (hardware callouts))
504
+ if ( (i_src == (OCCC_COMP_ID | 0x01 )) || // GEN_CALLHOME_LOG
505
+ ( (i_actions & TMGT_ERRL_ACTIONS_FORCE_ERROR_POSTED ) &&
506
+ (io_errlSeverity == ERRORLOG ::ERRL_SEV_INFORMATIONAL ) ) )
507
+ {
508
+ o_call_home = true;
509
+ }
510
+
511
+ // If reset required, save the SRC in case it leads to safe mode
512
+ if (l_occReset == true)
513
+ {
514
+ iv_needsReset = true;
515
+ OccManager ::updateSafeModeReason (i_src , iv_instance );
516
+ }
517
+
480
518
} // end Occ::elogProcessActions()
481
519
482
520
} // end namespace
0 commit comments