@@ -31,6 +31,7 @@ enum Trace {
31
31
Ready ,
32
32
Present { index : usize , present : bool } ,
33
33
TemperatureReadTimeout { index : usize , pos : usize } ,
34
+ DimmFailure { index : usize } ,
34
35
}
35
36
36
37
ringbuf ! ( Trace , 32 , Trace :: None ) ;
@@ -263,6 +264,15 @@ impl idol_runtime::NotificationHandler for ServerImpl {
263
264
} } ;
264
265
}
265
266
267
+ macro_rules! check_dimm_failure {
268
+ ( $dev: ident, $index: expr) => {
269
+ let $dev = self . dimms. dimm_pcamp. $dev( ) ;
270
+ if !$dev {
271
+ ringbuf_entry!( Trace :: DimmFailure { index: $index } ) ;
272
+ }
273
+ } ;
274
+ }
275
+
266
276
for ( index, present) in self . present . iter ( ) . cloned ( ) . enumerate ( ) {
267
277
let bus = index / 6 ; // FPGA bus (0 or 1)
268
278
let dev = index % 6 ; // device index (SDI, 0-6)
@@ -318,6 +328,46 @@ impl idol_runtime::NotificationHandler for ServerImpl {
318
328
319
329
// Send the value to the sensors task
320
330
self . sensor . post_now ( DIMM_SENSORS [ index] [ pos] , temp_c) ;
331
+
332
+ match index {
333
+ 0 => {
334
+ check_dimm_failure ! ( pcamp_a, 0 ) ;
335
+ }
336
+ 1 => {
337
+ check_dimm_failure ! ( pcamp_b, 1 ) ;
338
+ }
339
+ 2 => {
340
+ check_dimm_failure ! ( pcamp_c, 2 ) ;
341
+ }
342
+ 3 => {
343
+ check_dimm_failure ! ( pcamp_d, 3 ) ;
344
+ }
345
+ 4 => {
346
+ check_dimm_failure ! ( pcamp_e, 4 ) ;
347
+ }
348
+ 5 => {
349
+ check_dimm_failure ! ( pcamp_f, 5 ) ;
350
+ }
351
+ 6 => {
352
+ check_dimm_failure ! ( pcamp_g, 6 ) ;
353
+ }
354
+ 7 => {
355
+ check_dimm_failure ! ( pcamp_h, 7 ) ;
356
+ }
357
+ 8 => {
358
+ check_dimm_failure ! ( pcamp_i, 8 ) ;
359
+ }
360
+ 9 => {
361
+ check_dimm_failure ! ( pcamp_j, 9 ) ;
362
+ }
363
+ 10 => {
364
+ check_dimm_failure ! ( pcamp_k, 10 ) ;
365
+ }
366
+ 11 => {
367
+ check_dimm_failure ! ( pcamp_l, 11 ) ;
368
+ }
369
+ _ => unreachable ! ( ) ,
370
+ }
321
371
}
322
372
}
323
373
set_timer_relative ( TIMER_INTERVAL , notifications:: TIMER_MASK ) ;
0 commit comments