|
|
d9e469 |
From 0d53728f9cbdca5a1bd32c51a121dd1162f50e95 Mon Sep 17 00:00:00 2001
|
|
|
d9e469 |
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
|
|
|
d9e469 |
Date: Thu, 15 Aug 2013 12:45:18 -0300
|
|
|
d9e469 |
Subject: [PATCH 14/32] ras-mc-ctl: Fix label register with 2 layers
|
|
|
d9e469 |
|
|
|
d9e469 |
When there aren't 3 layers, label print/register weren't working.
|
|
|
d9e469 |
|
|
|
d9e469 |
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
|
|
|
d9e469 |
---
|
|
|
d9e469 |
util/ras-mc-ctl.in | 19 +++++++++++++------
|
|
|
d9e469 |
1 files changed, 13 insertions(+), 6 deletions(-)
|
|
|
d9e469 |
|
|
|
d9e469 |
diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in
|
|
|
d9e469 |
index f5a8ce5..a7137be 100755
|
|
|
d9e469 |
--- a/util/ras-mc-ctl.in
|
|
|
d9e469 |
+++ b/util/ras-mc-ctl.in
|
|
|
d9e469 |
@@ -508,7 +508,6 @@ sub parse_dimm_labels_file
|
|
|
d9e469 |
}
|
|
|
d9e469 |
map { $lh->{$vendor}{lc $_}{$mc}{$top}{$mid}{$low} = $label }
|
|
|
d9e469 |
@models;
|
|
|
d9e469 |
- $n = 3;
|
|
|
d9e469 |
}
|
|
|
d9e469 |
if (!$num) {
|
|
|
d9e469 |
$num = $n;
|
|
|
d9e469 |
@@ -542,9 +541,13 @@ sub parse_dimm_labels
|
|
|
d9e469 |
|
|
|
d9e469 |
sub read_dimm_label
|
|
|
d9e469 |
{
|
|
|
d9e469 |
- my ($mc, $top, $mid, $low) = @_;
|
|
|
d9e469 |
+ my ($num_layers, $mc, $top, $mid, $low) = @_;
|
|
|
d9e469 |
my $sysfs = "/sys/devices/system/edac/mc";
|
|
|
d9e469 |
- my $pos = "$mc:$top:$mid:$low";
|
|
|
d9e469 |
+ my $pos;
|
|
|
d9e469 |
+
|
|
|
d9e469 |
+ $pos = "$mc:$top:$mid:$low" if ($num_layers == 3);
|
|
|
d9e469 |
+ $pos = "$mc:$top:$mid" if ($num_layers == 2);
|
|
|
d9e469 |
+ $pos = "$mc:$top" if ($num_layers == 1);
|
|
|
d9e469 |
|
|
|
d9e469 |
if (!defined($dimm_node{$pos})) {
|
|
|
d9e469 |
my $label = "$pos missing";
|
|
|
d9e469 |
@@ -574,10 +577,14 @@ sub read_dimm_label
|
|
|
d9e469 |
|
|
|
d9e469 |
sub get_dimm_label_node
|
|
|
d9e469 |
{
|
|
|
d9e469 |
- my ($mc, $top, $mid, $low) = @_;
|
|
|
d9e469 |
+ my ($num_layers, $mc, $top, $mid, $low) = @_;
|
|
|
d9e469 |
my $sysfs = "/sys/devices/system/edac/mc";
|
|
|
d9e469 |
my $pos = "$mc:$top:$mid:$low";
|
|
|
d9e469 |
|
|
|
d9e469 |
+ $pos = "$mc:$top:$mid:$low" if ($num_layers == 3);
|
|
|
d9e469 |
+ $pos = "$mc:$top:$mid" if ($num_layers == 2);
|
|
|
d9e469 |
+ $pos = "$mc:$top" if ($num_layers == 1);
|
|
|
d9e469 |
+
|
|
|
d9e469 |
return "" if (!defined($dimm_node{$pos}));
|
|
|
d9e469 |
|
|
|
d9e469 |
my $dimm = $dimm_node{$pos};
|
|
|
d9e469 |
@@ -611,7 +618,7 @@ sub print_dimm_labels
|
|
|
d9e469 |
for my $mid (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}}) {
|
|
|
d9e469 |
for my $low (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}{$mid}}) {
|
|
|
d9e469 |
my $label = $$lref{$vendor}{$model}{$mc}{$top}{$mid}{$low};
|
|
|
d9e469 |
- my ($rlabel,$loc) = read_dimm_label ($mc, $top, $mid, $low);
|
|
|
d9e469 |
+ my ($rlabel,$loc) = read_dimm_label ($$num_layers{$vendor}{$model}, $mc, $top, $mid, $low);
|
|
|
d9e469 |
|
|
|
d9e469 |
printf $fh $format, $loc, $label, $rlabel;
|
|
|
d9e469 |
}
|
|
|
d9e469 |
@@ -645,7 +652,7 @@ sub register_dimm_labels
|
|
|
d9e469 |
for my $mid (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}}) {
|
|
|
d9e469 |
for my $low (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}{$mid}}) {
|
|
|
d9e469 |
|
|
|
d9e469 |
- my $file = get_dimm_label_node($mc, $top, $mid, $low);
|
|
|
d9e469 |
+ my $file = get_dimm_label_node($$num_layers{$vendor}{$model}, $mc, $top, $mid, $low);
|
|
|
d9e469 |
|
|
|
d9e469 |
# Ignore sysfs files that don't exist. Might just be
|
|
|
d9e469 |
# unpopulated bank.
|
|
|
d9e469 |
--
|
|
|
d9e469 |
1.7.1
|
|
|
d9e469 |
|