]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/edac/edac_mc_sysfs.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / drivers / edac / edac_mc_sysfs.c
index 39dbab7d62f150b7dd53a0657bb8beb3622bd762..445862dac273982147e7dc0464796fde6e34e129 100644 (file)
@@ -569,6 +569,40 @@ static ssize_t dimmdev_edac_mode_show(struct device *dev,
        return sprintf(data, "%s\n", edac_caps[dimm->edac_mode]);
 }
 
+static ssize_t dimmdev_ce_count_show(struct device *dev,
+                                     struct device_attribute *mattr,
+                                     char *data)
+{
+       struct dimm_info *dimm = to_dimm(dev);
+       u32 count;
+       int off;
+
+       off = EDAC_DIMM_OFF(dimm->mci->layers,
+                           dimm->mci->n_layers,
+                           dimm->location[0],
+                           dimm->location[1],
+                           dimm->location[2]);
+       count = dimm->mci->ce_per_layer[dimm->mci->n_layers-1][off];
+       return sprintf(data, "%u\n", count);
+}
+
+static ssize_t dimmdev_ue_count_show(struct device *dev,
+                                     struct device_attribute *mattr,
+                                     char *data)
+{
+       struct dimm_info *dimm = to_dimm(dev);
+       u32 count;
+       int off;
+
+       off = EDAC_DIMM_OFF(dimm->mci->layers,
+                           dimm->mci->n_layers,
+                           dimm->location[0],
+                           dimm->location[1],
+                           dimm->location[2]);
+       count = dimm->mci->ue_per_layer[dimm->mci->n_layers-1][off];
+       return sprintf(data, "%u\n", count);
+}
+
 /* dimm/rank attribute files */
 static DEVICE_ATTR(dimm_label, S_IRUGO | S_IWUSR,
                   dimmdev_label_show, dimmdev_label_store);
@@ -577,6 +611,8 @@ 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);
 
 /* attributes of the dimm<id>/rank<id> object */
 static struct attribute *dimm_attrs[] = {
@@ -586,6 +622,8 @@ static struct attribute *dimm_attrs[] = {
        &dev_attr_dimm_mem_type.attr,
        &dev_attr_dimm_dev_type.attr,
        &dev_attr_dimm_edac_mode.attr,
+       &dev_attr_dimm_ce_count.attr,
+       &dev_attr_dimm_ue_count.attr,
        NULL,
 };
 
@@ -831,7 +869,7 @@ static DEVICE_ATTR(ce_count, S_IRUGO, mci_ce_count_show, NULL);
 static DEVICE_ATTR(max_location, S_IRUGO, mci_max_location_show, NULL);
 
 /* memory scrubber attribute file */
-DEVICE_ATTR(sdram_scrub_rate, 0, mci_sdram_scrub_rate_show,
+static DEVICE_ATTR(sdram_scrub_rate, 0, mci_sdram_scrub_rate_show,
            mci_sdram_scrub_rate_store); /* umode set later in is_visible */
 
 static struct attribute *mci_attrs[] = {