diff options
-rw-r--r-- | Documentation/ABI/testing/sysfs-devices-edac | 17 | ||||
-rw-r--r-- | Documentation/admin-guide/ras.rst | 20 | ||||
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 38 |
3 files changed, 75 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-devices-edac b/Documentation/ABI/testing/sysfs-devices-edac index 6568e0010e1a..46ff929fd52a 100644 --- a/Documentation/ABI/testing/sysfs-devices-edac +++ b/Documentation/ABI/testing/sysfs-devices-edac | |||
@@ -138,3 +138,20 @@ Contact: Mauro Carvalho Chehab <m.chehab@samsung.com> | |||
138 | Description: This attribute file will display what type of memory is | 138 | Description: This attribute file will display what type of memory is |
139 | currently on this csrow. Normally, either buffered or | 139 | currently on this csrow. Normally, either buffered or |
140 | unbuffered memory (for example, Unbuffered-DDR3). | 140 | unbuffered memory (for example, Unbuffered-DDR3). |
141 | |||
142 | What: /sys/devices/system/edac/mc/mc*/(dimm|rank)*/dimm_ce_count | ||
143 | Date: October 2016 | ||
144 | Contact: linux-edac@vger.kernel.org | ||
145 | Description: This attribute file displays the total count of correctable | ||
146 | errors that have occurred on this DIMM. This count is very important | ||
147 | to examine. CEs provide early indications that a DIMM is beginning | ||
148 | to fail. This count field should be monitored for non-zero values | ||
149 | and report such information to the system administrator. | ||
150 | |||
151 | What: /sys/devices/system/edac/mc/mc*/(dimm|rank)*/dimm_ue_count | ||
152 | Date: October 2016 | ||
153 | Contact: linux-edac@vger.kernel.org | ||
154 | Description: This attribute file displays the total count of uncorrectable | ||
155 | errors that have occurred on this DIMM. If panic_on_ue is set, this | ||
156 | counter will not have a chance to increment, since EDAC will panic the | ||
157 | system | ||
diff --git a/Documentation/admin-guide/ras.rst b/Documentation/admin-guide/ras.rst index d71340e86c27..9939348bd4a3 100644 --- a/Documentation/admin-guide/ras.rst +++ b/Documentation/admin-guide/ras.rst | |||
@@ -438,11 +438,13 @@ A typical EDAC system has the following structure under | |||
438 | │ │ ├── ce_count | 438 | │ │ ├── ce_count |
439 | │ │ ├── ce_noinfo_count | 439 | │ │ ├── ce_noinfo_count |
440 | │ │ ├── dimm0 | 440 | │ │ ├── dimm0 |
441 | │ │ │ ├── dimm_ce_count | ||
441 | │ │ │ ├── dimm_dev_type | 442 | │ │ │ ├── dimm_dev_type |
442 | │ │ │ ├── dimm_edac_mode | 443 | │ │ │ ├── dimm_edac_mode |
443 | │ │ │ ├── dimm_label | 444 | │ │ │ ├── dimm_label |
444 | │ │ │ ├── dimm_location | 445 | │ │ │ ├── dimm_location |
445 | │ │ │ ├── dimm_mem_type | 446 | │ │ │ ├── dimm_mem_type |
447 | │ │ │ ├── dimm_ue_count | ||
446 | │ │ │ ├── size | 448 | │ │ │ ├── size |
447 | │ │ │ └── uevent | 449 | │ │ │ └── uevent |
448 | │ │ ├── max_location | 450 | │ │ ├── max_location |
@@ -457,11 +459,13 @@ A typical EDAC system has the following structure under | |||
457 | │ │ ├── ce_count | 459 | │ │ ├── ce_count |
458 | │ │ ├── ce_noinfo_count | 460 | │ │ ├── ce_noinfo_count |
459 | │ │ ├── dimm0 | 461 | │ │ ├── dimm0 |
462 | │ │ │ ├── dimm_ce_count | ||
460 | │ │ │ ├── dimm_dev_type | 463 | │ │ │ ├── dimm_dev_type |
461 | │ │ │ ├── dimm_edac_mode | 464 | │ │ │ ├── dimm_edac_mode |
462 | │ │ │ ├── dimm_label | 465 | │ │ │ ├── dimm_label |
463 | │ │ │ ├── dimm_location | 466 | │ │ │ ├── dimm_location |
464 | │ │ │ ├── dimm_mem_type | 467 | │ │ │ ├── dimm_mem_type |
468 | │ │ │ ├── dimm_ue_count | ||
465 | │ │ │ ├── size | 469 | │ │ │ ├── size |
466 | │ │ │ └── uevent | 470 | │ │ │ └── uevent |
467 | │ │ ├── max_location | 471 | │ │ ├── max_location |
@@ -483,6 +487,22 @@ this ``X`` memory module: | |||
483 | This attribute file displays, in count of megabytes, the memory | 487 | This attribute file displays, in count of megabytes, the memory |
484 | that this csrow contains. | 488 | that this csrow contains. |
485 | 489 | ||
490 | - ``dimm_ue_count`` - Uncorrectable Errors count attribute file | ||
491 | |||
492 | This attribute file displays the total count of uncorrectable | ||
493 | errors that have occurred on this DIMM. If panic_on_ue is set | ||
494 | this counter will not have a chance to increment, since EDAC | ||
495 | will panic the system. | ||
496 | |||
497 | - ``dimm_ce_count`` - Correctable Errors count attribute file | ||
498 | |||
499 | This attribute file displays the total count of correctable | ||
500 | errors that have occurred on this DIMM. This count is very | ||
501 | important to examine. CEs provide early indications that a | ||
502 | DIMM is beginning to fail. This count field should be | ||
503 | monitored for non-zero values and report such information | ||
504 | to the system administrator. | ||
505 | |||
486 | - ``dimm_dev_type`` - Device type attribute file | 506 | - ``dimm_dev_type`` - Device type attribute file |
487 | 507 | ||
488 | This attribute file will display what type of DRAM device is | 508 | This attribute file will display what type of DRAM device is |
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index cc45b1dc3321..445862dac273 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -569,6 +569,40 @@ static ssize_t dimmdev_edac_mode_show(struct device *dev, | |||
569 | return sprintf(data, "%s\n", edac_caps[dimm->edac_mode]); | 569 | return sprintf(data, "%s\n", edac_caps[dimm->edac_mode]); |
570 | } | 570 | } |
571 | 571 | ||
572 | static ssize_t dimmdev_ce_count_show(struct device *dev, | ||
573 | struct device_attribute *mattr, | ||
574 | char *data) | ||
575 | { | ||
576 | struct dimm_info *dimm = to_dimm(dev); | ||
577 | u32 count; | ||
578 | int off; | ||
579 | |||
580 | off = EDAC_DIMM_OFF(dimm->mci->layers, | ||
581 | dimm->mci->n_layers, | ||
582 | dimm->location[0], | ||
583 | dimm->location[1], | ||
584 | dimm->location[2]); | ||
585 | count = dimm->mci->ce_per_layer[dimm->mci->n_layers-1][off]; | ||
586 | return sprintf(data, "%u\n", count); | ||
587 | } | ||
588 | |||
589 | static ssize_t dimmdev_ue_count_show(struct device *dev, | ||
590 | struct device_attribute *mattr, | ||
591 | char *data) | ||
592 | { | ||
593 | struct dimm_info *dimm = to_dimm(dev); | ||
594 | u32 count; | ||
595 | int off; | ||
596 | |||
597 | off = EDAC_DIMM_OFF(dimm->mci->layers, | ||
598 | dimm->mci->n_layers, | ||
599 | dimm->location[0], | ||
600 | dimm->location[1], | ||
601 | dimm->location[2]); | ||
602 | count = dimm->mci->ue_per_layer[dimm->mci->n_layers-1][off]; | ||
603 | return sprintf(data, "%u\n", count); | ||
604 | } | ||
605 | |||
572 | /* dimm/rank attribute files */ | 606 | /* dimm/rank attribute files */ |
573 | static DEVICE_ATTR(dimm_label, S_IRUGO | S_IWUSR, | 607 | static DEVICE_ATTR(dimm_label, S_IRUGO | S_IWUSR, |
574 | dimmdev_label_show, dimmdev_label_store); | 608 | dimmdev_label_show, dimmdev_label_store); |
@@ -577,6 +611,8 @@ static DEVICE_ATTR(size, S_IRUGO, dimmdev_size_show, NULL); | |||
577 | static DEVICE_ATTR(dimm_mem_type, S_IRUGO, dimmdev_mem_type_show, NULL); | 611 | static DEVICE_ATTR(dimm_mem_type, S_IRUGO, dimmdev_mem_type_show, NULL); |
578 | static DEVICE_ATTR(dimm_dev_type, S_IRUGO, dimmdev_dev_type_show, NULL); | 612 | static DEVICE_ATTR(dimm_dev_type, S_IRUGO, dimmdev_dev_type_show, NULL); |
579 | static DEVICE_ATTR(dimm_edac_mode, S_IRUGO, dimmdev_edac_mode_show, NULL); | 613 | static DEVICE_ATTR(dimm_edac_mode, S_IRUGO, dimmdev_edac_mode_show, NULL); |
614 | static DEVICE_ATTR(dimm_ce_count, S_IRUGO, dimmdev_ce_count_show, NULL); | ||
615 | static DEVICE_ATTR(dimm_ue_count, S_IRUGO, dimmdev_ue_count_show, NULL); | ||
580 | 616 | ||
581 | /* attributes of the dimm<id>/rank<id> object */ | 617 | /* attributes of the dimm<id>/rank<id> object */ |
582 | static struct attribute *dimm_attrs[] = { | 618 | static struct attribute *dimm_attrs[] = { |
@@ -586,6 +622,8 @@ static struct attribute *dimm_attrs[] = { | |||
586 | &dev_attr_dimm_mem_type.attr, | 622 | &dev_attr_dimm_mem_type.attr, |
587 | &dev_attr_dimm_dev_type.attr, | 623 | &dev_attr_dimm_dev_type.attr, |
588 | &dev_attr_dimm_edac_mode.attr, | 624 | &dev_attr_dimm_edac_mode.attr, |
625 | &dev_attr_dimm_ce_count.attr, | ||
626 | &dev_attr_dimm_ue_count.attr, | ||
589 | NULL, | 627 | NULL, |
590 | }; | 628 | }; |
591 | 629 | ||