diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-10 12:25:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-25 06:38:19 -0400 |
commit | b70f833377fc80d7446218b36206e2e299fc6bfd (patch) | |
tree | a5efb25285eb6ffa1e0743365568d1559d52b851 /drivers/edac | |
parent | 582a899622f19005126d2858f08ee0c9dac34870 (diff) |
i5000: Fix the memory size calculation with 2R memories
When 2R memories are found, the memory size should be multiplied
by two, otherwise, it will report half of the memory size:
+-----------------------------------------------+
| mc0 |
| branch0 | branch1 |
| channel0 | channel1 | channel0 | channel1 |
-------+-----------------------------------------------+
slot3: | 0 MB | 0 MB | 0 MB | 0 MB |
slot2: | 0 MB | 0 MB | 0 MB | 0 MB |
-------+-----------------------------------------------+
slot1: | 0 MB | 0 MB | 0 MB | 0 MB |
slot0: | 1024 MB | 1024 MB | 1024 MB | 1024 MB |
-------+-----------------------------------------------+
(the above machine have 4 x 2GB 2R memories)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i5000_edac.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c index 39c63757c2a..6a49dd00b81 100644 --- a/drivers/edac/i5000_edac.c +++ b/drivers/edac/i5000_edac.c | |||
@@ -1012,6 +1012,10 @@ static void handle_channel(struct i5000_pvt *pvt, int slot, int channel, | |||
1012 | /* add the number of COLUMN bits */ | 1012 | /* add the number of COLUMN bits */ |
1013 | addrBits += MTR_DIMM_COLS_ADDR_BITS(mtr); | 1013 | addrBits += MTR_DIMM_COLS_ADDR_BITS(mtr); |
1014 | 1014 | ||
1015 | /* Dual-rank memories have twice the size */ | ||
1016 | if (dinfo->dual_rank) | ||
1017 | addrBits++; | ||
1018 | |||
1015 | addrBits += 6; /* add 64 bits per DIMM */ | 1019 | addrBits += 6; /* add 64 bits per DIMM */ |
1016 | addrBits -= 20; /* divide by 2^^20 */ | 1020 | addrBits -= 20; /* divide by 2^^20 */ |
1017 | addrBits -= 3; /* 8 bits per bytes */ | 1021 | addrBits -= 3; /* 8 bits per bytes */ |