diff options
author | Arvind R <arvino55@gmail.com> | 2011-10-12 00:58:56 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-10-29 15:29:42 -0400 |
commit | 6099e419ae7e1dd44c808693bd1905d22a6db15f (patch) | |
tree | 561c8433a6a9bc2b24bd32e8063edfb49ff63453 /drivers/edac/i82975x_edac.c | |
parent | 800100afc7a01ed581702bfaa6014f646e6eff5d (diff) |
edac:i82975x fix 32bit compile and cleanup
the clean up achieves:
1. fix warning on 32-bit compile
2. reorder info extraction for clarity
3. add error-trap diagnostic message
4. handle ALL modes of memory configurations
Signed-off-by: Arvind R. <arvino55@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/edac/i82975x_edac.c')
-rw-r--r-- | drivers/edac/i82975x_edac.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c index a5da732fe5b2..4184e0171f00 100644 --- a/drivers/edac/i82975x_edac.c +++ b/drivers/edac/i82975x_edac.c | |||
@@ -277,11 +277,9 @@ static void i82975x_get_error_info(struct mem_ctl_info *mci, | |||
277 | static int i82975x_process_error_info(struct mem_ctl_info *mci, | 277 | static int i82975x_process_error_info(struct mem_ctl_info *mci, |
278 | struct i82975x_error_info *info, int handle_errors) | 278 | struct i82975x_error_info *info, int handle_errors) |
279 | { | 279 | { |
280 | int row, multi_chan, chan; | 280 | int row, chan; |
281 | unsigned long offst, page; | 281 | unsigned long offst, page; |
282 | 282 | ||
283 | multi_chan = mci->csrows[0].nr_channels - 1; | ||
284 | |||
285 | if (!(info->errsts2 & 0x0003)) | 283 | if (!(info->errsts2 & 0x0003)) |
286 | return 0; | 284 | return 0; |
287 | 285 | ||
@@ -294,20 +292,30 @@ static int i82975x_process_error_info(struct mem_ctl_info *mci, | |||
294 | } | 292 | } |
295 | 293 | ||
296 | page = (unsigned long) info->eap; | 294 | page = (unsigned long) info->eap; |
297 | if (info->xeap & 1) | ||
298 | page |= 0x100000000ul; | ||
299 | chan = page & 1; | ||
300 | page >>= 1; | 295 | page >>= 1; |
301 | offst = page & ((1 << PAGE_SHIFT) - 1); | 296 | if (info->xeap & 1) |
302 | page >>= PAGE_SHIFT; | 297 | page |= 0x80000000; |
298 | page >>= (PAGE_SHIFT - 1); | ||
303 | row = edac_mc_find_csrow_by_page(mci, page); | 299 | row = edac_mc_find_csrow_by_page(mci, page); |
304 | 300 | ||
301 | if (row == -1) { | ||
302 | i82975x_mc_printk(mci, KERN_ERR, "error processing EAP:\n" | ||
303 | "\tXEAP=%u\n" | ||
304 | "\t EAP=0x%08x\n" | ||
305 | "\tPAGE=0x%08x\n", | ||
306 | (info->xeap & 1) ? 1 : 0, info->eap, (unsigned int) page); | ||
307 | return 0; | ||
308 | } | ||
309 | chan = (mci->csrows[row].nr_channels == 1) ? 0 : info->eap & 1; | ||
310 | offst = info->eap | ||
311 | & ((1 << PAGE_SHIFT) - | ||
312 | (1 << mci->csrows[row].grain)); | ||
313 | |||
305 | if (info->errsts & 0x0002) | 314 | if (info->errsts & 0x0002) |
306 | edac_mc_handle_ue(mci, page, offst , row, "i82975x UE"); | 315 | edac_mc_handle_ue(mci, page, offst , row, "i82975x UE"); |
307 | else | 316 | else |
308 | edac_mc_handle_ce(mci, page, offst, info->derrsyn, row, | 317 | edac_mc_handle_ce(mci, page, offst, info->derrsyn, row, |
309 | multi_chan ? chan : 0, | 318 | chan, "i82975x CE"); |
310 | "i82975x CE"); | ||
311 | 319 | ||
312 | return 1; | 320 | return 1; |
313 | } | 321 | } |
@@ -410,7 +418,7 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci, | |||
410 | csrow->last_page = cumul_size - 1; | 418 | csrow->last_page = cumul_size - 1; |
411 | csrow->nr_pages = cumul_size - last_cumul_size; | 419 | csrow->nr_pages = cumul_size - last_cumul_size; |
412 | last_cumul_size = cumul_size; | 420 | last_cumul_size = cumul_size; |
413 | csrow->grain = 1 << 6; /* I82975X_EAP has 64B resolution */ | 421 | csrow->grain = 1 << 7; /* 128Byte cache-line resolution */ |
414 | csrow->mtype = MEM_DDR2; /* I82975x supports only DDR2 */ | 422 | csrow->mtype = MEM_DDR2; /* I82975x supports only DDR2 */ |
415 | csrow->dtype = i82975x_dram_type(mch_window, index); | 423 | csrow->dtype = i82975x_dram_type(mch_window, index); |
416 | csrow->edac_mode = EDAC_SECDED; /* only supported */ | 424 | csrow->edac_mode = EDAC_SECDED; /* only supported */ |