aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-08-27 14:44:43 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-30 13:57:03 -0400
commit37b69cf91c2c6e60856ad1ac4c37ccb2005ebbd3 (patch)
treecec2976c1b6e6e0f0e0ce6c4eec3c59dec435210 /drivers/edac
parent32f9472613b30791d8cb5a953791cf4647166744 (diff)
i7300_edac: Properly detect channel on CE errors
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/i7300_edac.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
index a06db65e1fef..a85a8e5163b7 100644
--- a/drivers/edac/i7300_edac.c
+++ b/drivers/edac/i7300_edac.c
@@ -101,7 +101,6 @@
101 #define IS_SINGLE_MODE(mca) ((mca) & (1 << 14)) 101 #define IS_SINGLE_MODE(mca) ((mca) & (1 << 14))
102 102
103#define TOLM 0x6C 103#define TOLM 0x6C
104#define REDMEMB 0x7C
105 104
106#define MIR0 0x80 105#define MIR0 0x80
107#define MIR1 0x84 106#define MIR1 0x84
@@ -279,6 +278,9 @@ static const char *ferr_global_lo_name[] = {
279 278
280#define REDMEMA 0xdc 279#define REDMEMA 0xdc
281 280
281#define REDMEMB 0x7c
282 #define IS_SECOND_CH(v) ((v) * (1 << 17))
283
282#define RECMEMA 0xe0 284#define RECMEMA 0xe0
283 #define RECMEMA_BANK(v) (((v) >> 12) & 7) 285 #define RECMEMA_BANK(v) (((v) >> 12) & 7)
284 #define RECMEMA_RANK(v) (((v) >> 8) & 15) 286 #define RECMEMA_RANK(v) (((v) >> 8) & 15)
@@ -414,7 +416,7 @@ static void i7300_process_fbd_error(struct mem_ctl_info *mci)
414 struct i7300_pvt *pvt; 416 struct i7300_pvt *pvt;
415 u32 errnum, value; 417 u32 errnum, value;
416 u16 val16; 418 u16 val16;
417 unsigned branch, bank, rank, cas, ras; 419 unsigned branch, channel, bank, rank, cas, ras;
418 u32 syndrome; 420 u32 syndrome;
419 421
420 unsigned long errors; 422 unsigned long errors;
@@ -488,12 +490,19 @@ static void i7300_process_fbd_error(struct mem_ctl_info *mci)
488 cas = RECMEMB_CAS(value); 490 cas = RECMEMB_CAS(value);
489 ras = RECMEMB_RAS(value); 491 ras = RECMEMB_RAS(value);
490 492
493 pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map,
494 REDMEMB, &value);
495
496 channel = (branch << 1);
497 if (IS_SECOND_CH(value))
498 channel++;
499
491 /* Form out message */ 500 /* Form out message */
492 snprintf(pvt->tmp_prt_buffer, PAGE_SIZE, 501 snprintf(pvt->tmp_prt_buffer, PAGE_SIZE,
493 "Corrected error (Branch=%d (channel %d or %d), " 502 "Corrected error (Branch=%d, Channel %d), "
494 " DRAM-Bank=%d %s " 503 " DRAM-Bank=%d %s "
495 "RAS=%d CAS=%d, CE Err=0x%lx, Syndrome=0x%08x(%s))", 504 "RAS=%d CAS=%d, CE Err=0x%lx, Syndrome=0x%08x(%s))",
496 branch, branch << 1, (branch << 1) + 1, 505 branch, channel,
497 bank, 506 bank,
498 is_wr ? "RDWR" : "RD", 507 is_wr ? "RDWR" : "RD",
499 ras, cas, 508 ras, cas,
@@ -505,7 +514,7 @@ static void i7300_process_fbd_error(struct mem_ctl_info *mci)
505 * Currently, we don't know how to identify the right 514 * Currently, we don't know how to identify the right
506 * channel. 515 * channel.
507 */ 516 */
508 edac_mc_handle_fbd_ce(mci, rank, branch << 1, 517 edac_mc_handle_fbd_ce(mci, rank, channel,
509 pvt->tmp_prt_buffer); 518 pvt->tmp_prt_buffer);
510 } 519 }
511 return; 520 return;