From dfb2a76378f095b0aaa2024ce9a8cfb2ae2354d2 Mon Sep 17 00:00:00 2001 From: Brian Pomerantz Date: Mon, 12 Feb 2007 00:53:03 -0800 Subject: [PATCH] EDAC: e752x bit mask fix The fatal vs. non-fatal mask for the sysbus FERR status is incorrect according to the E7520 datasheet. This patch corrects the mask to correctly handle fatal and non-fatal errors. Signed-off-by: Brian Pomerantz Signed-off-by: Dave Jiang Signed-off-by: Doug Thompson Cc: Alan Cox Cc: Andi Kleen Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/edac/e752x_edac.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/edac/e752x_edac.c') diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c index c82bc0ed7f1..ab9873924f4 100644 --- a/drivers/edac/e752x_edac.c +++ b/drivers/edac/e752x_edac.c @@ -556,17 +556,17 @@ static void e752x_check_sysbus(struct e752x_error_info *info, error32 = (stat32 >> 16) & 0x3ff; stat32 = stat32 & 0x3ff; - if(stat32 & 0x083) - sysbus_error(1, stat32 & 0x083, error_found, handle_error); + if(stat32 & 0x087) + sysbus_error(1, stat32 & 0x087, error_found, handle_error); - if(stat32 & 0x37c) - sysbus_error(0, stat32 & 0x37c, error_found, handle_error); + if(stat32 & 0x378) + sysbus_error(0, stat32 & 0x378, error_found, handle_error); - if(error32 & 0x083) - sysbus_error(1, error32 & 0x083, error_found, handle_error); + if(error32 & 0x087) + sysbus_error(1, error32 & 0x087, error_found, handle_error); - if(error32 & 0x37c) - sysbus_error(0, error32 & 0x37c, error_found, handle_error); + if(error32 & 0x378) + sysbus_error(0, error32 & 0x378, error_found, handle_error); } static void e752x_check_membuf (struct e752x_error_info *info, -- cgit v1.2.3 From 9962fd017becf944d671da498ccaaea570452206 Mon Sep 17 00:00:00 2001 From: Brian Pomerantz Date: Mon, 12 Feb 2007 00:53:05 -0800 Subject: [PATCH] EDAC: e752x byte access fix The reading of the DRA registers should be a byte at a time (one register at a time) instead of 4 bytes at a time (four registers). Reading a dword at a time retrieves erroneous information from all but the first register. A change was made to read in each register in a loop prior to using the data in those registers. Signed-off-by: Brian Pomerantz Signed-off-by: Dave Jiang Signed-off-by: Doug Thompson Cc: Alan Cox Cc: Andi Kleen Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/edac/e752x_edac.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/edac/e752x_edac.c') diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c index ab9873924f4..9abfc0dc3ba 100644 --- a/drivers/edac/e752x_edac.c +++ b/drivers/edac/e752x_edac.c @@ -782,7 +782,12 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, u8 value; u32 dra, drc, cumul_size; - pci_read_config_dword(pdev, E752X_DRA, &dra); + dra = 0; + for (index=0; index < 4; index++) { + u8 dra_reg; + pci_read_config_byte(pdev, E752X_DRA+index, &dra_reg); + dra |= dra_reg << (index * 8); + } pci_read_config_dword(pdev, E752X_DRC, &drc); drc_chan = dual_channel_active(ddrcsr); drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */ -- cgit v1.2.3 From 84db003f249ddbcde1666376b4e3bbe9ee2c7c0c Mon Sep 17 00:00:00 2001 From: Mike Chan Date: Mon, 12 Feb 2007 00:53:06 -0800 Subject: [PATCH] EDAC: Fix in e752x mc driver This fix/change returns the offset into the page for the ce/ue error, instead of just 0. The e752x dram controller reads 34:6 of the linear address with the error. Signed-off-by: Mike Chan Signed-off-by: doug thompson Acked-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/edac/e752x_edac.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'drivers/edac/e752x_edac.c') diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c index 9abfc0dc3ba..8bcc887692a 100644 --- a/drivers/edac/e752x_edac.c +++ b/drivers/edac/e752x_edac.c @@ -285,8 +285,9 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, if (!pvt->map_type) row = 7 - row; - edac_mc_handle_ce(mci, page, 0, sec1_syndrome, row, channel, - "e752x CE"); + /* e752x mc reads 34:6 of the DRAM linear address */ + edac_mc_handle_ce(mci, page, offset_in_page(sec1_add << 4), + sec1_syndrome, row, channel, "e752x CE"); } static inline void process_ce(struct mem_ctl_info *mci, u16 error_one, @@ -319,8 +320,10 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, ((block_page >> 1) & 3) : edac_mc_find_csrow_by_page(mci, block_page); - edac_mc_handle_ue(mci, block_page, 0, row, - "e752x UE from Read"); + /* e752x mc reads 34:6 of the DRAM linear address */ + edac_mc_handle_ue(mci, block_page, + offset_in_page(error_2b << 4), + row, "e752x UE from Read"); } if (error_one & 0x0404) { error_2b = scrb_add; @@ -333,8 +336,10 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, ((block_page >> 1) & 3) : edac_mc_find_csrow_by_page(mci, block_page); - edac_mc_handle_ue(mci, block_page, 0, row, - "e752x UE from Scruber"); + /* e752x mc reads 34:6 of the DRAM linear address */ + edac_mc_handle_ue(mci, block_page, + offset_in_page(error_2b << 4), + row, "e752x UE from Scruber"); } } -- cgit v1.2.3