edac: core fix redundant sysfs controls to parameters

/sys/devices/system/edac/mc has a few files which are duplicated in
/sys/module/edac_core/parameters. Now that all the functionality is
duplicated between these two locations, we remove the former kobject
attributes and update the documentation.

Signed-off-by: Arthur Jones <ajones@riverbed.com>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arthur Jones and committed by
Linus Torvalds
327dafb1 096846e2

+73 -195
+72 -79
Documentation/edac.txt
··· 222 222 set of DIMMs for channels 0 and 1. 223 223 224 224 225 - Within each of the 'mc','mcX' and 'csrowX' directories are several 225 + Within each of the 'mcX' and 'csrowX' directories are several 226 226 EDAC control and attribute files. 227 - 228 - 229 - ============================================================================ 230 - DIRECTORY 'mc' 231 - 232 - In directory 'mc' are EDAC system overall control and attribute files: 233 - 234 - 235 - Panic on UE control file: 236 - 237 - 'edac_mc_panic_on_ue' 238 - 239 - An uncorrectable error will cause a machine panic. This is usually 240 - desirable. It is a bad idea to continue when an uncorrectable error 241 - occurs - it is indeterminate what was uncorrected and the operating 242 - system context might be so mangled that continuing will lead to further 243 - corruption. If the kernel has MCE configured, then EDAC will never 244 - notice the UE. 245 - 246 - LOAD TIME: module/kernel parameter: panic_on_ue=[0|1] 247 - 248 - RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_panic_on_ue 249 - 250 - 251 - Log UE control file: 252 - 253 - 'edac_mc_log_ue' 254 - 255 - Generate kernel messages describing uncorrectable errors. These errors 256 - are reported through the system message log system. UE statistics 257 - will be accumulated even when UE logging is disabled. 258 - 259 - LOAD TIME: module/kernel parameter: log_ue=[0|1] 260 - 261 - RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_log_ue 262 - 263 - 264 - Log CE control file: 265 - 266 - 'edac_mc_log_ce' 267 - 268 - Generate kernel messages describing correctable errors. These 269 - errors are reported through the system message log system. 270 - CE statistics will be accumulated even when CE logging is disabled. 271 - 272 - LOAD TIME: module/kernel parameter: log_ce=[0|1] 273 - 274 - RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_log_ce 275 - 276 - 277 - Polling period control file: 278 - 279 - 'edac_mc_poll_msec' 280 - 281 - The time period, in milliseconds, for polling for error information. 282 - Too small a value wastes resources. Too large a value might delay 283 - necessary handling of errors and might loose valuable information for 284 - locating the error. 1000 milliseconds (once each second) is the current 285 - default. Systems which require all the bandwidth they can get, may 286 - increase this. 287 - 288 - LOAD TIME: module/kernel parameter: poll_msec=[0|1] 289 - 290 - RUN TIME: echo "1000" >/sys/devices/system/edac/mc/edac_mc_poll_msec 291 - 292 227 293 228 ============================================================================ 294 229 'mcX' DIRECTORIES ··· 472 537 motherboard specific and determination of this information 473 538 must occur in userland at this time. 474 539 475 - 476 540 ============================================================================ 477 541 SYSTEM LOGGING 478 542 ··· 502 568 Both UEs and CEs with no info will lack all but memory controller, 503 569 error type, a notice of "no info" and then an optional, 504 570 driver-specific error message. 505 - 506 571 507 572 508 573 ============================================================================ ··· 537 604 echo "0" >/sys/devices/system/edac/pci/check_pci_parity 538 605 539 606 607 + Parity Count: 608 + 609 + 'pci_parity_count' 610 + 611 + This attribute file will display the number of parity errors that 612 + have been detected. 613 + 614 + 615 + ============================================================================ 616 + MODULE PARAMETERS 617 + 618 + Panic on UE control file: 619 + 620 + 'edac_mc_panic_on_ue' 621 + 622 + An uncorrectable error will cause a machine panic. This is usually 623 + desirable. It is a bad idea to continue when an uncorrectable error 624 + occurs - it is indeterminate what was uncorrected and the operating 625 + system context might be so mangled that continuing will lead to further 626 + corruption. If the kernel has MCE configured, then EDAC will never 627 + notice the UE. 628 + 629 + LOAD TIME: module/kernel parameter: edac_mc_panic_on_ue=[0|1] 630 + 631 + RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_panic_on_ue 632 + 633 + 634 + Log UE control file: 635 + 636 + 'edac_mc_log_ue' 637 + 638 + Generate kernel messages describing uncorrectable errors. These errors 639 + are reported through the system message log system. UE statistics 640 + will be accumulated even when UE logging is disabled. 641 + 642 + LOAD TIME: module/kernel parameter: edac_mc_log_ue=[0|1] 643 + 644 + RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ue 645 + 646 + 647 + Log CE control file: 648 + 649 + 'edac_mc_log_ce' 650 + 651 + Generate kernel messages describing correctable errors. These 652 + errors are reported through the system message log system. 653 + CE statistics will be accumulated even when CE logging is disabled. 654 + 655 + LOAD TIME: module/kernel parameter: edac_mc_log_ce=[0|1] 656 + 657 + RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ce 658 + 659 + 660 + Polling period control file: 661 + 662 + 'edac_mc_poll_msec' 663 + 664 + The time period, in milliseconds, for polling for error information. 665 + Too small a value wastes resources. Too large a value might delay 666 + necessary handling of errors and might loose valuable information for 667 + locating the error. 1000 milliseconds (once each second) is the current 668 + default. Systems which require all the bandwidth they can get, may 669 + increase this. 670 + 671 + LOAD TIME: module/kernel parameter: edac_mc_poll_msec=[0|1] 672 + 673 + RUN TIME: echo "1000" > /sys/module/edac_core/parameters/edac_mc_poll_msec 674 + 540 675 541 676 Panic on PCI PARITY Error: 542 677 ··· 615 614 error has been detected. 616 615 617 616 618 - module/kernel parameter: panic_on_pci_parity=[0|1] 617 + module/kernel parameter: edac_panic_on_pci_pe=[0|1] 619 618 620 619 Enable: 621 - echo "1" >/sys/devices/system/edac/pci/panic_on_pci_parity 620 + echo "1" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe 622 621 623 622 Disable: 624 - echo "0" >/sys/devices/system/edac/pci/panic_on_pci_parity 625 - 626 - 627 - Parity Count: 628 - 629 - 'pci_parity_count' 630 - 631 - This attribute file will display the number of parity errors that 632 - have been detected. 623 + echo "0" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe 633 624 634 625 635 626
+1 -116
drivers/edac/edac_mc_sysfs.c
··· 123 123 124 124 125 125 126 - /* 127 - * /sys/devices/system/edac/mc; 128 - * data structures and methods 129 - */ 130 - static ssize_t memctrl_int_show(void *ptr, char *buffer) 131 - { 132 - int *value = (int *)ptr; 133 - return sprintf(buffer, "%u\n", *value); 134 - } 135 - 136 126 static ssize_t memctrl_int_store(void *ptr, const char *buffer, size_t count) 137 127 { 138 128 int *value = (int *)ptr; 139 129 140 130 if (isdigit(*buffer)) 141 131 *value = simple_strtoul(buffer, NULL, 0); 142 - 143 - return count; 144 - } 145 - 146 - /* 147 - * mc poll_msec time value 148 - */ 149 - static ssize_t poll_msec_int_store(void *ptr, const char *buffer, size_t count) 150 - { 151 - int *value = (int *)ptr; 152 - 153 - if (isdigit(*buffer)) { 154 - *value = simple_strtoul(buffer, NULL, 0); 155 - 156 - /* notify edac_mc engine to reset the poll period */ 157 - edac_mc_reset_delay_period(*value); 158 - } 159 132 160 133 return count; 161 134 } ··· 642 669 .default_attrs = (struct attribute **)mci_attr, 643 670 }; 644 671 645 - /* show/store, tables, etc for the MC kset */ 646 - 647 - 648 - struct memctrl_dev_attribute { 649 - struct attribute attr; 650 - void *value; 651 - ssize_t(*show) (void *, char *); 652 - ssize_t(*store) (void *, const char *, size_t); 653 - }; 654 - 655 - /* Set of show/store abstract level functions for memory control object */ 656 - static ssize_t memctrl_dev_show(struct kobject *kobj, 657 - struct attribute *attr, char *buffer) 658 - { 659 - struct memctrl_dev_attribute *memctrl_dev; 660 - memctrl_dev = (struct memctrl_dev_attribute *)attr; 661 - 662 - if (memctrl_dev->show) 663 - return memctrl_dev->show(memctrl_dev->value, buffer); 664 - 665 - return -EIO; 666 - } 667 - 668 - static ssize_t memctrl_dev_store(struct kobject *kobj, struct attribute *attr, 669 - const char *buffer, size_t count) 670 - { 671 - struct memctrl_dev_attribute *memctrl_dev; 672 - memctrl_dev = (struct memctrl_dev_attribute *)attr; 673 - 674 - if (memctrl_dev->store) 675 - return memctrl_dev->store(memctrl_dev->value, buffer, count); 676 - 677 - return -EIO; 678 - } 679 - 680 - static struct sysfs_ops memctrlfs_ops = { 681 - .show = memctrl_dev_show, 682 - .store = memctrl_dev_store 683 - }; 684 - 685 - #define MEMCTRL_ATTR(_name, _mode, _show, _store) \ 686 - static struct memctrl_dev_attribute attr_##_name = { \ 687 - .attr = {.name = __stringify(_name), .mode = _mode }, \ 688 - .value = &_name, \ 689 - .show = _show, \ 690 - .store = _store, \ 691 - }; 692 - 693 - #define MEMCTRL_STRING_ATTR(_name, _data, _mode, _show, _store) \ 694 - static struct memctrl_dev_attribute attr_##_name = { \ 695 - .attr = {.name = __stringify(_name), .mode = _mode }, \ 696 - .value = _data, \ 697 - .show = _show, \ 698 - .store = _store, \ 699 - }; 700 - 701 - /* csrow<id> control files */ 702 - MEMCTRL_ATTR(edac_mc_panic_on_ue, 703 - S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); 704 - 705 - MEMCTRL_ATTR(edac_mc_log_ue, 706 - S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); 707 - 708 - MEMCTRL_ATTR(edac_mc_log_ce, 709 - S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); 710 - 711 - MEMCTRL_ATTR(edac_mc_poll_msec, 712 - S_IRUGO | S_IWUSR, memctrl_int_show, poll_msec_int_store); 713 - 714 - /* Base Attributes of the memory ECC object */ 715 - static struct memctrl_dev_attribute *memctrl_attr[] = { 716 - &attr_edac_mc_panic_on_ue, 717 - &attr_edac_mc_log_ue, 718 - &attr_edac_mc_log_ce, 719 - &attr_edac_mc_poll_msec, 720 - NULL, 721 - }; 722 - 723 - 724 - /* the ktype for the mc_kset internal kobj */ 725 - static struct kobj_type ktype_mc_set_attribs = { 726 - .sysfs_ops = &memctrlfs_ops, 727 - .default_attrs = (struct attribute **)memctrl_attr, 728 - }; 729 - 730 672 /* EDAC memory controller sysfs kset: 731 673 * /sys/devices/system/edac/mc 732 674 */ 733 - static struct kset mc_kset = { 734 - .kobj = {.ktype = &ktype_mc_set_attribs }, 735 - }; 736 - 675 + static struct kset mc_kset; 737 676 738 677 /* 739 678 * edac_mc_register_sysfs_main_kobj