diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-27 16:38:08 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-28 18:10:58 -0400 |
commit | 084a4fccef39ac7abb039511f32380f28d0b67e6 (patch) | |
tree | 0596612000c7ec3a848b10f7cc4acdb573218076 /drivers/edac/edac_mc.c | |
parent | a7d7d2e1a07e3811dc49af2962c940fd8bbb6c8f (diff) |
edac: move dimm properties to struct dimm_info
On systems based on chip select rows, all channels need to use memories
with the same properties, otherwise the memories on channels A and B
won't be recognized.
However, such assumption is not true for all types of memory
controllers.
Controllers for FB-DIMM's don't have such requirements.
Also, modern Intel controllers seem to be capable of handling such
differences.
So, we need to get rid of storing the DIMM information into a per-csrow
data, storing it, instead at the right place.
The first step is to move grain, mtype, dtype and edac_mode to the
per-dimm struct.
Reviewed-by: Aristeu Rozanski <arozansk@redhat.com>
Reviewed-by: Borislav Petkov <borislav.petkov@amd.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Cc: Doug Thompson <norsk5@yahoo.com>
Cc: Borislav Petkov <borislav.petkov@amd.com>
Cc: Mark Gross <mark.gross@intel.com>
Cc: Jason Uhlenkott <juhlenko@akamai.com>
Cc: Tim Small <tim@buttersideup.com>
Cc: Ranganathan Desikan <ravi@jetztechnologies.com>
Cc: "Arvind R." <arvino55@gmail.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Egor Martovetsky <egor@pasemi.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Joe Perches <joe@perches.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Hitoshi Mitake <h.mitake@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: James Bottomley <James.Bottomley@parallels.com>
Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com>
Cc: Shaohui Xie <Shaohui.Xie@freescale.com>
Cc: Josh Boyer <jwboyer@gmail.com>
Cc: Mike Williams <mike@mikebwilliams.com>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac/edac_mc.c')
-rw-r--r-- | drivers/edac/edac_mc.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index c1aae7233022..0942efad55c1 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -43,7 +43,7 @@ static void edac_mc_dump_channel(struct rank_info *chan) | |||
43 | { | 43 | { |
44 | debugf4("\tchannel = %p\n", chan); | 44 | debugf4("\tchannel = %p\n", chan); |
45 | debugf4("\tchannel->chan_idx = %d\n", chan->chan_idx); | 45 | debugf4("\tchannel->chan_idx = %d\n", chan->chan_idx); |
46 | debugf4("\tchannel->ce_count = %d\n", chan->ce_count); | 46 | debugf4("\tchannel->ce_count = %d\n", chan->dimm->ce_count); |
47 | debugf4("\tchannel->label = '%s'\n", chan->dimm->label); | 47 | debugf4("\tchannel->label = '%s'\n", chan->dimm->label); |
48 | debugf4("\tchannel->csrow = %p\n\n", chan->csrow); | 48 | debugf4("\tchannel->csrow = %p\n\n", chan->csrow); |
49 | } | 49 | } |
@@ -695,6 +695,7 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci, | |||
695 | { | 695 | { |
696 | unsigned long remapped_page; | 696 | unsigned long remapped_page; |
697 | char *label = NULL; | 697 | char *label = NULL; |
698 | u32 grain; | ||
698 | 699 | ||
699 | debugf3("MC%d: %s()\n", mci->mc_idx, __func__); | 700 | debugf3("MC%d: %s()\n", mci->mc_idx, __func__); |
700 | 701 | ||
@@ -719,6 +720,7 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci, | |||
719 | } | 720 | } |
720 | 721 | ||
721 | label = mci->csrows[row].channels[channel].dimm->label; | 722 | label = mci->csrows[row].channels[channel].dimm->label; |
723 | grain = mci->csrows[row].channels[channel].dimm->grain; | ||
722 | 724 | ||
723 | if (edac_mc_get_log_ce()) | 725 | if (edac_mc_get_log_ce()) |
724 | /* FIXME - put in DIMM location */ | 726 | /* FIXME - put in DIMM location */ |
@@ -726,11 +728,12 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci, | |||
726 | "CE page 0x%lx, offset 0x%lx, grain %d, syndrome " | 728 | "CE page 0x%lx, offset 0x%lx, grain %d, syndrome " |
727 | "0x%lx, row %d, channel %d, label \"%s\": %s\n", | 729 | "0x%lx, row %d, channel %d, label \"%s\": %s\n", |
728 | page_frame_number, offset_in_page, | 730 | page_frame_number, offset_in_page, |
729 | mci->csrows[row].grain, syndrome, row, channel, | 731 | grain, syndrome, row, channel, |
730 | label, msg); | 732 | label, msg); |
731 | 733 | ||
732 | mci->ce_count++; | 734 | mci->ce_count++; |
733 | mci->csrows[row].ce_count++; | 735 | mci->csrows[row].ce_count++; |
736 | mci->csrows[row].channels[channel].dimm->ce_count++; | ||
734 | mci->csrows[row].channels[channel].ce_count++; | 737 | mci->csrows[row].channels[channel].ce_count++; |
735 | 738 | ||
736 | if (mci->scrub_mode & SCRUB_SW_SRC) { | 739 | if (mci->scrub_mode & SCRUB_SW_SRC) { |
@@ -747,8 +750,7 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci, | |||
747 | mci->ctl_page_to_phys(mci, page_frame_number) : | 750 | mci->ctl_page_to_phys(mci, page_frame_number) : |
748 | page_frame_number; | 751 | page_frame_number; |
749 | 752 | ||
750 | edac_mc_scrub_block(remapped_page, offset_in_page, | 753 | edac_mc_scrub_block(remapped_page, offset_in_page, grain); |
751 | mci->csrows[row].grain); | ||
752 | } | 754 | } |
753 | } | 755 | } |
754 | EXPORT_SYMBOL_GPL(edac_mc_handle_ce); | 756 | EXPORT_SYMBOL_GPL(edac_mc_handle_ce); |
@@ -774,6 +776,7 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci, | |||
774 | int chan; | 776 | int chan; |
775 | int chars; | 777 | int chars; |
776 | char *label = NULL; | 778 | char *label = NULL; |
779 | u32 grain; | ||
777 | 780 | ||
778 | debugf3("MC%d: %s()\n", mci->mc_idx, __func__); | 781 | debugf3("MC%d: %s()\n", mci->mc_idx, __func__); |
779 | 782 | ||
@@ -787,6 +790,7 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci, | |||
787 | return; | 790 | return; |
788 | } | 791 | } |
789 | 792 | ||
793 | grain = mci->csrows[row].channels[0].dimm->grain; | ||
790 | label = mci->csrows[row].channels[0].dimm->label; | 794 | label = mci->csrows[row].channels[0].dimm->label; |
791 | chars = snprintf(pos, len + 1, "%s", label); | 795 | chars = snprintf(pos, len + 1, "%s", label); |
792 | len -= chars; | 796 | len -= chars; |
@@ -804,14 +808,13 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci, | |||
804 | edac_mc_printk(mci, KERN_EMERG, | 808 | edac_mc_printk(mci, KERN_EMERG, |
805 | "UE page 0x%lx, offset 0x%lx, grain %d, row %d, " | 809 | "UE page 0x%lx, offset 0x%lx, grain %d, row %d, " |
806 | "labels \"%s\": %s\n", page_frame_number, | 810 | "labels \"%s\": %s\n", page_frame_number, |
807 | offset_in_page, mci->csrows[row].grain, row, | 811 | offset_in_page, grain, row, labels, msg); |
808 | labels, msg); | ||
809 | 812 | ||
810 | if (edac_mc_get_panic_on_ue()) | 813 | if (edac_mc_get_panic_on_ue()) |
811 | panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, " | 814 | panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, " |
812 | "row %d, labels \"%s\": %s\n", mci->mc_idx, | 815 | "row %d, labels \"%s\": %s\n", mci->mc_idx, |
813 | page_frame_number, offset_in_page, | 816 | page_frame_number, offset_in_page, |
814 | mci->csrows[row].grain, row, labels, msg); | 817 | grain, row, labels, msg); |
815 | 818 | ||
816 | mci->ue_count++; | 819 | mci->ue_count++; |
817 | mci->csrows[row].ue_count++; | 820 | mci->csrows[row].ue_count++; |
@@ -883,6 +886,7 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci, | |||
883 | chars = snprintf(pos, len + 1, "%s", label); | 886 | chars = snprintf(pos, len + 1, "%s", label); |
884 | len -= chars; | 887 | len -= chars; |
885 | pos += chars; | 888 | pos += chars; |
889 | |||
886 | chars = snprintf(pos, len + 1, "-%s", | 890 | chars = snprintf(pos, len + 1, "-%s", |
887 | mci->csrows[csrow].channels[channelb].dimm->label); | 891 | mci->csrows[csrow].channels[channelb].dimm->label); |
888 | 892 | ||
@@ -936,6 +940,7 @@ void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci, | |||
936 | 940 | ||
937 | mci->ce_count++; | 941 | mci->ce_count++; |
938 | mci->csrows[csrow].ce_count++; | 942 | mci->csrows[csrow].ce_count++; |
943 | mci->csrows[csrow].channels[channel].dimm->ce_count++; | ||
939 | mci->csrows[csrow].channels[channel].ce_count++; | 944 | mci->csrows[csrow].channels[channel].ce_count++; |
940 | } | 945 | } |
941 | EXPORT_SYMBOL(edac_mc_handle_fbd_ce); | 946 | EXPORT_SYMBOL(edac_mc_handle_fbd_ce); |