aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-09-24 10:29:02 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-09-24 13:16:12 -0400
commit1aa4a7b6b082adbfa704988dd098bc96b8837d5a (patch)
tree75b1b0febe5c3160dd028c19aaf9031d66469050 /drivers/edac
parent3c9c92b6b5016a2e02c3438386b1c5efe7f588e4 (diff)
V4L/DVB: i7300_edac: better initialize page counts
It is still somewhat fake, as the pages may not be on this exact order, and may even be used in mirror mode, but this is a best guess than the other random fake values. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/i7300_edac.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
index 38920c0b5fb..38d9cb8fad7 100644
--- a/drivers/edac/i7300_edac.c
+++ b/drivers/edac/i7300_edac.c
@@ -616,7 +616,8 @@ static void i7300_enable_error_reporting(struct mem_ctl_info *mci)
616static int decode_mtr(struct i7300_pvt *pvt, 616static int decode_mtr(struct i7300_pvt *pvt,
617 int slot, int ch, int branch, 617 int slot, int ch, int branch,
618 struct i7300_dimm_info *dinfo, 618 struct i7300_dimm_info *dinfo,
619 struct csrow_info *p_csrow) 619 struct csrow_info *p_csrow,
620 u32 *last_page)
620{ 621{
621 int mtr, ans, addrBits, channel; 622 int mtr, ans, addrBits, channel;
622 623
@@ -663,6 +664,11 @@ static int decode_mtr(struct i7300_pvt *pvt,
663 p_csrow->grain = 8; 664 p_csrow->grain = 8;
664 p_csrow->nr_pages = dinfo->megabytes << 8; 665 p_csrow->nr_pages = dinfo->megabytes << 8;
665 p_csrow->mtype = MEM_FB_DDR2; 666 p_csrow->mtype = MEM_FB_DDR2;
667 p_csrow->csrow_idx = slot;
668 p_csrow->first_page = *last_page;
669 *last_page += p_csrow->nr_pages;
670 p_csrow->last_page = *last_page;
671 p_csrow->page_mask = 0;
666 672
667 /* 673 /*
668 * The type of error detection actually depends of the 674 * The type of error detection actually depends of the
@@ -774,6 +780,7 @@ static int i7300_init_csrows(struct mem_ctl_info *mci)
774 int rc = -ENODEV; 780 int rc = -ENODEV;
775 int mtr; 781 int mtr;
776 int ch, branch, slot, channel; 782 int ch, branch, slot, channel;
783 u32 last_page = 0;
777 784
778 pvt = mci->pvt_info; 785 pvt = mci->pvt_info;
779 786
@@ -811,18 +818,11 @@ static int i7300_init_csrows(struct mem_ctl_info *mci)
811 p_csrow = &mci->csrows[slot]; 818 p_csrow = &mci->csrows[slot];
812 819
813 mtr = decode_mtr(pvt, slot, ch, branch, 820 mtr = decode_mtr(pvt, slot, ch, branch,
814 dinfo, p_csrow); 821 dinfo, p_csrow, &last_page);
815 /* if no DIMMS on this row, continue */ 822 /* if no DIMMS on this row, continue */
816 if (!MTR_DIMMS_PRESENT(mtr)) 823 if (!MTR_DIMMS_PRESENT(mtr))
817 continue; 824 continue;
818 825
819 p_csrow->csrow_idx = slot;
820
821 /* FAKE OUT VALUES, FIXME */
822 p_csrow->first_page = 0 + slot * 20;
823 p_csrow->last_page = 9 + slot * 20;
824 p_csrow->page_mask = 0xfff;
825
826 rc = 0; 826 rc = 0;
827 } 827 }
828 } 828 }