hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/edac/edac_device.c
....@@ -555,11 +555,15 @@
555555 return edac_dev->panic_on_ue;
556556 }
557557
558
-void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
559
- int inst_nr, int block_nr, const char *msg)
558
+void edac_device_handle_ce_count(struct edac_device_ctl_info *edac_dev,
559
+ unsigned int count, int inst_nr, int block_nr,
560
+ const char *msg)
560561 {
561562 struct edac_device_instance *instance;
562563 struct edac_device_block *block = NULL;
564
+
565
+ if (!count)
566
+ return;
563567
564568 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
565569 edac_device_printk(edac_dev, KERN_ERR,
....@@ -582,26 +586,30 @@
582586
583587 if (instance->nr_blocks > 0) {
584588 block = instance->blocks + block_nr;
585
- block->counters.ce_count++;
589
+ block->counters.ce_count += count;
586590 }
587591
588592 /* Propagate the count up the 'totals' tree */
589
- instance->counters.ce_count++;
590
- edac_dev->counters.ce_count++;
593
+ instance->counters.ce_count += count;
594
+ edac_dev->counters.ce_count += count;
591595
592596 if (edac_device_get_log_ce(edac_dev))
593597 edac_device_printk(edac_dev, KERN_WARNING,
594
- "CE: %s instance: %s block: %s '%s'\n",
595
- edac_dev->ctl_name, instance->name,
596
- block ? block->name : "N/A", msg);
598
+ "CE: %s instance: %s block: %s count: %d '%s'\n",
599
+ edac_dev->ctl_name, instance->name,
600
+ block ? block->name : "N/A", count, msg);
597601 }
598
-EXPORT_SYMBOL_GPL(edac_device_handle_ce);
602
+EXPORT_SYMBOL_GPL(edac_device_handle_ce_count);
599603
600
-void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
601
- int inst_nr, int block_nr, const char *msg)
604
+void edac_device_handle_ue_count(struct edac_device_ctl_info *edac_dev,
605
+ unsigned int count, int inst_nr, int block_nr,
606
+ const char *msg)
602607 {
603608 struct edac_device_instance *instance;
604609 struct edac_device_block *block = NULL;
610
+
611
+ if (!count)
612
+ return;
605613
606614 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
607615 edac_device_printk(edac_dev, KERN_ERR,
....@@ -624,22 +632,22 @@
624632
625633 if (instance->nr_blocks > 0) {
626634 block = instance->blocks + block_nr;
627
- block->counters.ue_count++;
635
+ block->counters.ue_count += count;
628636 }
629637
630638 /* Propagate the count up the 'totals' tree */
631
- instance->counters.ue_count++;
632
- edac_dev->counters.ue_count++;
639
+ instance->counters.ue_count += count;
640
+ edac_dev->counters.ue_count += count;
633641
634642 if (edac_device_get_log_ue(edac_dev))
635643 edac_device_printk(edac_dev, KERN_EMERG,
636
- "UE: %s instance: %s block: %s '%s'\n",
637
- edac_dev->ctl_name, instance->name,
638
- block ? block->name : "N/A", msg);
644
+ "UE: %s instance: %s block: %s count: %d '%s'\n",
645
+ edac_dev->ctl_name, instance->name,
646
+ block ? block->name : "N/A", count, msg);
639647
640648 if (edac_device_get_panic_on_ue(edac_dev))
641
- panic("EDAC %s: UE instance: %s block %s '%s'\n",
642
- edac_dev->ctl_name, instance->name,
643
- block ? block->name : "N/A", msg);
649
+ panic("EDAC %s: UE instance: %s block %s count: %d '%s'\n",
650
+ edac_dev->ctl_name, instance->name,
651
+ block ? block->name : "N/A", count, msg);
644652 }
645
-EXPORT_SYMBOL_GPL(edac_device_handle_ue);
653
+EXPORT_SYMBOL_GPL(edac_device_handle_ue_count);