#include <linux/ctype.h>
#include <linux/slab.h>
#include <linux/edac.h>
#include <linux/bug.h>
#include <linux/pm_runtime.h>
#include <linux/uaccess.h>
#include "edac_mc.h"
#include "edac_module.h"
static int edac_mc_log_ue = …;
static int edac_mc_log_ce = …;
static int edac_mc_panic_on_ue;
static unsigned int edac_mc_poll_msec = …;
int edac_mc_get_log_ue(void)
{ … }
int edac_mc_get_log_ce(void)
{ … }
int edac_mc_get_panic_on_ue(void)
{ … }
unsigned int edac_mc_get_poll_msec(void)
{ … }
static int edac_set_poll_msec(const char *val, const struct kernel_param *kp)
{ … }
module_param(edac_mc_panic_on_ue, int, 0644);
MODULE_PARM_DESC(…) …;
module_param(edac_mc_log_ue, int, 0644);
MODULE_PARM_DESC(…) …;
module_param(edac_mc_log_ce, int, 0644);
MODULE_PARM_DESC(…) …;
module_param_call(…);
MODULE_PARM_DESC(…) …;
static struct device *mci_pdev;
static const char * const dev_types[] = …;
static const char * const edac_caps[] = …;
#ifdef CONFIG_EDAC_LEGACY_SYSFS
#define to_csrow(k) …
#define DEVICE_ATTR_LEGACY(_name, _mode, _show, _store) …
struct dev_ch_attribute { … };
#define DEVICE_CHANNEL(_name, _mode, _show, _store, _var) …
#define to_channel(k) …
static ssize_t csrow_ue_count_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t csrow_ce_count_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t csrow_size_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t csrow_mem_type_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t csrow_dev_type_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t csrow_edac_mode_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t channel_dimm_label_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t channel_dimm_label_store(struct device *dev,
struct device_attribute *mattr,
const char *data, size_t count)
{ … }
static ssize_t channel_ce_count_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
DEVICE_ATTR_LEGACY(…);
DEVICE_ATTR_LEGACY(…);
DEVICE_ATTR_LEGACY(…);
DEVICE_ATTR_LEGACY(…);
DEVICE_ATTR_LEGACY(…);
DEVICE_ATTR_LEGACY(…);
static struct attribute *csrow_attrs[] = …;
static const struct attribute_group csrow_attr_grp = …;
static const struct attribute_group *csrow_attr_groups[] = …;
static const struct device_type csrow_attr_type = …;
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
static struct attribute *dynamic_csrow_dimm_attr[] = …;
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
DEVICE_CHANNEL(…);
static struct attribute *dynamic_csrow_ce_count_attr[] = …;
static umode_t csrow_dev_is_visible(struct kobject *kobj,
struct attribute *attr, int idx)
{ … }
static const struct attribute_group csrow_dev_dimm_group = …;
static const struct attribute_group csrow_dev_ce_count_group = …;
static const struct attribute_group *csrow_dev_groups[] = …;
static void csrow_release(struct device *dev)
{ … }
static inline int nr_pages_per_csrow(struct csrow_info *csrow)
{ … }
static int edac_create_csrow_object(struct mem_ctl_info *mci,
struct csrow_info *csrow, int index)
{ … }
static int edac_create_csrow_objects(struct mem_ctl_info *mci)
{ … }
static void edac_delete_csrow_objects(struct mem_ctl_info *mci)
{ … }
#endif
#define to_dimm(k) …
static ssize_t dimmdev_location_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t dimmdev_label_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t dimmdev_label_store(struct device *dev,
struct device_attribute *mattr,
const char *data,
size_t count)
{ … }
static ssize_t dimmdev_size_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t dimmdev_mem_type_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t dimmdev_dev_type_show(struct device *dev,
struct device_attribute *mattr, char *data)
{ … }
static ssize_t dimmdev_edac_mode_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t dimmdev_ce_count_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t dimmdev_ue_count_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static DEVICE_ATTR(dimm_label, S_IRUGO | S_IWUSR,
dimmdev_label_show, dimmdev_label_store);
static DEVICE_ATTR(dimm_location, S_IRUGO, dimmdev_location_show, NULL);
static DEVICE_ATTR(size, S_IRUGO, dimmdev_size_show, NULL);
static DEVICE_ATTR(dimm_mem_type, S_IRUGO, dimmdev_mem_type_show, NULL);
static DEVICE_ATTR(dimm_dev_type, S_IRUGO, dimmdev_dev_type_show, NULL);
static DEVICE_ATTR(dimm_edac_mode, S_IRUGO, dimmdev_edac_mode_show, NULL);
static DEVICE_ATTR(dimm_ce_count, S_IRUGO, dimmdev_ce_count_show, NULL);
static DEVICE_ATTR(dimm_ue_count, S_IRUGO, dimmdev_ue_count_show, NULL);
static struct attribute *dimm_attrs[] = …;
static const struct attribute_group dimm_attr_grp = …;
static const struct attribute_group *dimm_attr_groups[] = …;
static const struct device_type dimm_attr_type = …;
static void dimm_release(struct device *dev)
{ … }
static int edac_create_dimm_object(struct mem_ctl_info *mci,
struct dimm_info *dimm)
{ … }
#define to_mci(k) …
static ssize_t mci_reset_counters_store(struct device *dev,
struct device_attribute *mattr,
const char *data, size_t count)
{ … }
static ssize_t mci_sdram_scrub_rate_store(struct device *dev,
struct device_attribute *mattr,
const char *data, size_t count)
{ … }
static ssize_t mci_sdram_scrub_rate_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t mci_ue_count_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t mci_ce_count_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t mci_ce_noinfo_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t mci_ue_noinfo_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t mci_seconds_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t mci_ctl_name_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t mci_size_mb_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t mci_max_location_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static DEVICE_ATTR(reset_counters, S_IWUSR, NULL, mci_reset_counters_store);
static DEVICE_ATTR(mc_name, S_IRUGO, mci_ctl_name_show, NULL);
static DEVICE_ATTR(size_mb, S_IRUGO, mci_size_mb_show, NULL);
static DEVICE_ATTR(seconds_since_reset, S_IRUGO, mci_seconds_show, NULL);
static DEVICE_ATTR(ue_noinfo_count, S_IRUGO, mci_ue_noinfo_show, NULL);
static DEVICE_ATTR(ce_noinfo_count, S_IRUGO, mci_ce_noinfo_show, NULL);
static DEVICE_ATTR(ue_count, S_IRUGO, mci_ue_count_show, NULL);
static DEVICE_ATTR(ce_count, S_IRUGO, mci_ce_count_show, NULL);
static DEVICE_ATTR(max_location, S_IRUGO, mci_max_location_show, NULL);
static DEVICE_ATTR(sdram_scrub_rate, 0, mci_sdram_scrub_rate_show,
mci_sdram_scrub_rate_store);
static struct attribute *mci_attrs[] = …;
static umode_t mci_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int idx)
{ … }
static const struct attribute_group mci_attr_grp = …;
static const struct attribute_group *mci_attr_groups[] = …;
static const struct device_type mci_attr_type = …;
int edac_create_sysfs_mci_device(struct mem_ctl_info *mci,
const struct attribute_group **groups)
{ … }
void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
{ … }
static void mc_attr_release(struct device *dev)
{ … }
int __init edac_mc_sysfs_init(void)
{ … }
void edac_mc_sysfs_exit(void)
{ … }