diff options
author | Mark A. Grondona <mgrondona@llnl.gov> | 2011-10-18 09:02:58 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-01 08:01:55 -0400 |
commit | c6e13b528f5a6c6a6ae260007d4fd14c3dbc5648 (patch) | |
tree | 92703334e6ed7b715d55c304735358c41e288d41 /drivers/edac | |
parent | 3d78c9af78e080db1961fd30ede1720d6e6e5999 (diff) |
EDAC: Fix incorrect edac mode reporting in sb_edac
The edac driver for Sandy Bridge was found to be reporting "FPM"
for edac_mode, which clearly doesn't make sense. It was found that
sb_edac.c:get_dimm_config was reusing a variable for both mem_type
and edac_type, and thus was overwriting the value after setting
it correctly. This patch fixes that issue.
Before the patch:
/sys/devices/system/edac/mc/mc0/csrow0/edac_mode:FPM
/sys/devices/system/edac/mc/mc0/csrow1/edac_mode:FPM
/sys/devices/system/edac/mc/mc0/csrow2/edac_mode:FPM
/sys/devices/system/edac/mc/mc0/csrow3/edac_mode:FPM
After:
/sys/devices/system/edac/mc/mc0/csrow0/edac_mode:S4ECD4ED
/sys/devices/system/edac/mc/mc0/csrow1/edac_mode:S4ECD4ED
/sys/devices/system/edac/mc/mc0/csrow2/edac_mode:S4ECD4ED
/sys/devices/system/edac/mc/mc0/csrow3/edac_mode:S4ECD4ED
Signed-off-by: Mark A. Grondona <mgrondona@llnl.gov>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/sb_edac.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 8118f12cb8c7..7a402bfbee7d 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c | |||
@@ -559,6 +559,7 @@ static int get_dimm_config(const struct mem_ctl_info *mci) | |||
559 | unsigned long last_page = 0; | 559 | unsigned long last_page = 0; |
560 | u32 reg; | 560 | u32 reg; |
561 | enum edac_type mode; | 561 | enum edac_type mode; |
562 | enum mem_type mtype; | ||
562 | 563 | ||
563 | pci_read_config_dword(pvt->pci_br, SAD_TARGET, ®); | 564 | pci_read_config_dword(pvt->pci_br, SAD_TARGET, ®); |
564 | pvt->sbridge_dev->source_id = SOURCE_ID(reg); | 565 | pvt->sbridge_dev->source_id = SOURCE_ID(reg); |
@@ -601,10 +602,10 @@ static int get_dimm_config(const struct mem_ctl_info *mci) | |||
601 | if (IS_RDIMM_ENABLED(reg)) { | 602 | if (IS_RDIMM_ENABLED(reg)) { |
602 | /* FIXME: Can also be LRDIMM */ | 603 | /* FIXME: Can also be LRDIMM */ |
603 | debugf0("Memory is registered\n"); | 604 | debugf0("Memory is registered\n"); |
604 | mode = MEM_RDDR3; | 605 | mtype = MEM_RDDR3; |
605 | } else { | 606 | } else { |
606 | debugf0("Memory is unregistered\n"); | 607 | debugf0("Memory is unregistered\n"); |
607 | mode = MEM_DDR3; | 608 | mtype = MEM_DDR3; |
608 | } | 609 | } |
609 | 610 | ||
610 | /* On all supported DDR3 DIMM types, there are 8 banks available */ | 611 | /* On all supported DDR3 DIMM types, there are 8 banks available */ |
@@ -643,7 +644,7 @@ static int get_dimm_config(const struct mem_ctl_info *mci) | |||
643 | csr->dtype = (banks == 8) ? DEV_X8 : DEV_X4; | 644 | csr->dtype = (banks == 8) ? DEV_X8 : DEV_X4; |
644 | csr->ce_count = 0; | 645 | csr->ce_count = 0; |
645 | csr->ue_count = 0; | 646 | csr->ue_count = 0; |
646 | csr->mtype = mode; | 647 | csr->mtype = mtype; |
647 | csr->edac_mode = mode; | 648 | csr->edac_mode = mode; |
648 | csr->nr_channels = 1; | 649 | csr->nr_channels = 1; |
649 | csr->channels[0].chan_idx = i; | 650 | csr->channels[0].chan_idx = i; |