aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/edac.h47
1 files changed, 33 insertions, 14 deletions
diff --git a/include/linux/edac.h b/include/linux/edac.h
index 4e32e8d31e0a..a2b0b6fc002c 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -13,6 +13,7 @@
13#define _LINUX_EDAC_H_ 13#define _LINUX_EDAC_H_
14 14
15#include <linux/atomic.h> 15#include <linux/atomic.h>
16#include <linux/device.h>
16#include <linux/kobject.h> 17#include <linux/kobject.h>
17#include <linux/completion.h> 18#include <linux/completion.h>
18#include <linux/workqueue.h> 19#include <linux/workqueue.h>
@@ -448,14 +449,15 @@ struct edac_mc_layer {
448 __p; \ 449 __p; \
449}) 450})
450 451
451
452/* FIXME: add the proper per-location error counts */
453struct dimm_info { 452struct dimm_info {
453 struct device dev;
454
454 char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */ 455 char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */
455 456
456 /* Memory location data */ 457 /* Memory location data */
457 unsigned location[EDAC_MAX_LAYERS]; 458 unsigned location[EDAC_MAX_LAYERS];
458 459
460 struct kobject kobj; /* sysfs kobject for this csrow */
459 struct mem_ctl_info *mci; /* the parent */ 461 struct mem_ctl_info *mci; /* the parent */
460 462
461 u32 grain; /* granularity of reported error in bytes */ 463 u32 grain; /* granularity of reported error in bytes */
@@ -484,6 +486,8 @@ struct dimm_info {
484 * patches in this series will fix this issue. 486 * patches in this series will fix this issue.
485 */ 487 */
486struct rank_info { 488struct rank_info {
489 struct device dev;
490
487 int chan_idx; 491 int chan_idx;
488 struct csrow_info *csrow; 492 struct csrow_info *csrow;
489 struct dimm_info *dimm; 493 struct dimm_info *dimm;
@@ -492,6 +496,8 @@ struct rank_info {
492}; 496};
493 497
494struct csrow_info { 498struct csrow_info {
499 struct device dev;
500
495 /* Used only by edac_mc_find_csrow_by_page() */ 501 /* Used only by edac_mc_find_csrow_by_page() */
496 unsigned long first_page; /* first page number in csrow */ 502 unsigned long first_page; /* first page number in csrow */
497 unsigned long last_page; /* last page number in csrow */ 503 unsigned long last_page; /* last page number in csrow */
@@ -517,15 +523,6 @@ struct mcidev_sysfs_group {
517 const struct mcidev_sysfs_attribute *mcidev_attr; /* group attributes */ 523 const struct mcidev_sysfs_attribute *mcidev_attr; /* group attributes */
518}; 524};
519 525
520struct mcidev_sysfs_group_kobj {
521 struct list_head list; /* list for all instances within a mc */
522
523 struct kobject kobj; /* kobj for the group */
524
525 const struct mcidev_sysfs_group *grp; /* group description table */
526 struct mem_ctl_info *mci; /* the parent */
527};
528
529/* mcidev_sysfs_attribute structure 526/* mcidev_sysfs_attribute structure
530 * used for driver sysfs attributes and in mem_ctl_info 527 * used for driver sysfs attributes and in mem_ctl_info
531 * sysfs top level entries 528 * sysfs top level entries
@@ -536,13 +533,27 @@ struct mcidev_sysfs_attribute {
536 const struct mcidev_sysfs_group *grp; /* Points to a group of attributes */ 533 const struct mcidev_sysfs_group *grp; /* Points to a group of attributes */
537 534
538 /* Ops for show/store values at the attribute - not used on group */ 535 /* Ops for show/store values at the attribute - not used on group */
539 ssize_t (*show)(struct mem_ctl_info *,char *); 536 ssize_t (*show)(struct mem_ctl_info *, char *);
540 ssize_t (*store)(struct mem_ctl_info *, const char *,size_t); 537 ssize_t (*store)(struct mem_ctl_info *, const char *, size_t);
538
539 void *priv;
540};
541
542/*
543 * struct errcount_attribute - used to store the several error counts
544 */
545struct errcount_attribute_data {
546 int n_layers;
547 int pos[EDAC_MAX_LAYERS];
548 int layer0, layer1, layer2;
541}; 549};
542 550
543/* MEMORY controller information structure 551/* MEMORY controller information structure
544 */ 552 */
545struct mem_ctl_info { 553struct mem_ctl_info {
554 struct device dev;
555 struct bus_type bus;
556
546 struct list_head link; /* for global list of mem_ctl_info structs */ 557 struct list_head link; /* for global list of mem_ctl_info structs */
547 558
548 struct module *owner; /* Module owner of this control struct */ 559 struct module *owner; /* Module owner of this control struct */
@@ -587,7 +598,15 @@ struct mem_ctl_info {
587 struct csrow_info *csrows; 598 struct csrow_info *csrows;
588 unsigned nr_csrows, num_cschannel; 599 unsigned nr_csrows, num_cschannel;
589 600
590 /* Memory Controller hierarchy */ 601 /*
602 * Memory Controller hierarchy
603 *
604 * There are basically two types of memory controller: the ones that
605 * sees memory sticks ("dimms"), and the ones that sees memory ranks.
606 * All old memory controllers enumerate memories per rank, but most
607 * of the recent drivers enumerate memories per DIMM, instead.
608 * When the memory controller is per rank, mem_is_per_rank is true.
609 */
591 unsigned n_layers; 610 unsigned n_layers;
592 struct edac_mc_layer *layers; 611 struct edac_mc_layer *layers;
593 bool mem_is_per_rank; 612 bool mem_is_per_rank;