diff options
author | Dave Jiang <djiang@mvista.com> | 2007-07-19 04:50:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:54 -0400 |
commit | 203333cbbaae3941504c2b6e92850783bf361b6f (patch) | |
tree | c205152abe7fed4c219066bd1f8d5e299c9ff5f6 /drivers/edac | |
parent | 466b71d58413a515a8029b4eccf98c08b8bb5aca (diff) |
drivers/edac: Lindent e752x
Run e752x_edac.c file through Lindent for cleanup
Signed-off-by: Dave Jiang <djiang@mvista.com>
Signed-off-by: Douglas Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/e752x_edac.c | 328 |
1 files changed, 158 insertions, 170 deletions
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c index d8b86584afbb..45c55a067c73 100644 --- a/drivers/edac/e752x_edac.c +++ b/drivers/edac/e752x_edac.c | |||
@@ -204,27 +204,24 @@ struct e752x_error_info { | |||
204 | 204 | ||
205 | static const struct e752x_dev_info e752x_devs[] = { | 205 | static const struct e752x_dev_info e752x_devs[] = { |
206 | [E7520] = { | 206 | [E7520] = { |
207 | .err_dev = PCI_DEVICE_ID_INTEL_7520_1_ERR, | 207 | .err_dev = PCI_DEVICE_ID_INTEL_7520_1_ERR, |
208 | .ctl_dev = PCI_DEVICE_ID_INTEL_7520_0, | 208 | .ctl_dev = PCI_DEVICE_ID_INTEL_7520_0, |
209 | .ctl_name = "E7520" | 209 | .ctl_name = "E7520"}, |
210 | }, | ||
211 | [E7525] = { | 210 | [E7525] = { |
212 | .err_dev = PCI_DEVICE_ID_INTEL_7525_1_ERR, | 211 | .err_dev = PCI_DEVICE_ID_INTEL_7525_1_ERR, |
213 | .ctl_dev = PCI_DEVICE_ID_INTEL_7525_0, | 212 | .ctl_dev = PCI_DEVICE_ID_INTEL_7525_0, |
214 | .ctl_name = "E7525" | 213 | .ctl_name = "E7525"}, |
215 | }, | ||
216 | [E7320] = { | 214 | [E7320] = { |
217 | .err_dev = PCI_DEVICE_ID_INTEL_7320_1_ERR, | 215 | .err_dev = PCI_DEVICE_ID_INTEL_7320_1_ERR, |
218 | .ctl_dev = PCI_DEVICE_ID_INTEL_7320_0, | 216 | .ctl_dev = PCI_DEVICE_ID_INTEL_7320_0, |
219 | .ctl_name = "E7320" | 217 | .ctl_name = "E7320"}, |
220 | }, | ||
221 | }; | 218 | }; |
222 | 219 | ||
223 | static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, | 220 | static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, |
224 | unsigned long page) | 221 | unsigned long page) |
225 | { | 222 | { |
226 | u32 remap; | 223 | u32 remap; |
227 | struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info; | 224 | struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info; |
228 | 225 | ||
229 | debugf3("%s()\n", __func__); | 226 | debugf3("%s()\n", __func__); |
230 | 227 | ||
@@ -244,13 +241,13 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, | |||
244 | } | 241 | } |
245 | 242 | ||
246 | static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, | 243 | static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, |
247 | u32 sec1_add, u16 sec1_syndrome) | 244 | u32 sec1_add, u16 sec1_syndrome) |
248 | { | 245 | { |
249 | u32 page; | 246 | u32 page; |
250 | int row; | 247 | int row; |
251 | int channel; | 248 | int channel; |
252 | int i; | 249 | int i; |
253 | struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info; | 250 | struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info; |
254 | 251 | ||
255 | debugf3("%s()\n", __func__); | 252 | debugf3("%s()\n", __func__); |
256 | 253 | ||
@@ -262,9 +259,10 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, | |||
262 | /* chip select are bits 14 & 13 */ | 259 | /* chip select are bits 14 & 13 */ |
263 | row = ((page >> 1) & 3); | 260 | row = ((page >> 1) & 3); |
264 | e752x_printk(KERN_WARNING, | 261 | e752x_printk(KERN_WARNING, |
265 | "Test row %d Table %d %d %d %d %d %d %d %d\n", row, | 262 | "Test row %d Table %d %d %d %d %d %d %d %d\n", row, |
266 | pvt->map[0], pvt->map[1], pvt->map[2], pvt->map[3], | 263 | pvt->map[0], pvt->map[1], pvt->map[2], pvt->map[3], |
267 | pvt->map[4], pvt->map[5], pvt->map[6], pvt->map[7]); | 264 | pvt->map[4], pvt->map[5], pvt->map[6], |
265 | pvt->map[7]); | ||
268 | 266 | ||
269 | /* test for channel remapping */ | 267 | /* test for channel remapping */ |
270 | for (i = 0; i < 8; i++) { | 268 | for (i = 0; i < 8; i++) { |
@@ -278,7 +276,8 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, | |||
278 | row = i; | 276 | row = i; |
279 | else | 277 | else |
280 | e752x_mc_printk(mci, KERN_WARNING, | 278 | e752x_mc_printk(mci, KERN_WARNING, |
281 | "row %d not found in remap table\n", row); | 279 | "row %d not found in remap table\n", |
280 | row); | ||
282 | } else | 281 | } else |
283 | row = edac_mc_find_csrow_by_page(mci, page); | 282 | row = edac_mc_find_csrow_by_page(mci, page); |
284 | 283 | ||
@@ -290,12 +289,12 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, | |||
290 | 289 | ||
291 | /* e752x mc reads 34:6 of the DRAM linear address */ | 290 | /* e752x mc reads 34:6 of the DRAM linear address */ |
292 | edac_mc_handle_ce(mci, page, offset_in_page(sec1_add << 4), | 291 | edac_mc_handle_ce(mci, page, offset_in_page(sec1_add << 4), |
293 | sec1_syndrome, row, channel, "e752x CE"); | 292 | sec1_syndrome, row, channel, "e752x CE"); |
294 | } | 293 | } |
295 | 294 | ||
296 | static inline void process_ce(struct mem_ctl_info *mci, u16 error_one, | 295 | static inline void process_ce(struct mem_ctl_info *mci, u16 error_one, |
297 | u32 sec1_add, u16 sec1_syndrome, int *error_found, | 296 | u32 sec1_add, u16 sec1_syndrome, int *error_found, |
298 | int handle_error) | 297 | int handle_error) |
299 | { | 298 | { |
300 | *error_found = 1; | 299 | *error_found = 1; |
301 | 300 | ||
@@ -304,11 +303,11 @@ static inline void process_ce(struct mem_ctl_info *mci, u16 error_one, | |||
304 | } | 303 | } |
305 | 304 | ||
306 | static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, | 305 | static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, |
307 | u32 ded_add, u32 scrb_add) | 306 | u32 ded_add, u32 scrb_add) |
308 | { | 307 | { |
309 | u32 error_2b, block_page; | 308 | u32 error_2b, block_page; |
310 | int row; | 309 | int row; |
311 | struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info; | 310 | struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info; |
312 | 311 | ||
313 | debugf3("%s()\n", __func__); | 312 | debugf3("%s()\n", __func__); |
314 | 313 | ||
@@ -319,14 +318,14 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, | |||
319 | block_page = error_2b >> (PAGE_SHIFT - 4); | 318 | block_page = error_2b >> (PAGE_SHIFT - 4); |
320 | 319 | ||
321 | row = pvt->mc_symmetric ? | 320 | row = pvt->mc_symmetric ? |
322 | /* chip select are bits 14 & 13 */ | 321 | /* chip select are bits 14 & 13 */ |
323 | ((block_page >> 1) & 3) : | 322 | ((block_page >> 1) & 3) : |
324 | edac_mc_find_csrow_by_page(mci, block_page); | 323 | edac_mc_find_csrow_by_page(mci, block_page); |
325 | 324 | ||
326 | /* e752x mc reads 34:6 of the DRAM linear address */ | 325 | /* e752x mc reads 34:6 of the DRAM linear address */ |
327 | edac_mc_handle_ue(mci, block_page, | 326 | edac_mc_handle_ue(mci, block_page, |
328 | offset_in_page(error_2b << 4), | 327 | offset_in_page(error_2b << 4), |
329 | row, "e752x UE from Read"); | 328 | row, "e752x UE from Read"); |
330 | } | 329 | } |
331 | if (error_one & 0x0404) { | 330 | if (error_one & 0x0404) { |
332 | error_2b = scrb_add; | 331 | error_2b = scrb_add; |
@@ -335,19 +334,20 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, | |||
335 | block_page = error_2b >> (PAGE_SHIFT - 4); | 334 | block_page = error_2b >> (PAGE_SHIFT - 4); |
336 | 335 | ||
337 | row = pvt->mc_symmetric ? | 336 | row = pvt->mc_symmetric ? |
338 | /* chip select are bits 14 & 13 */ | 337 | /* chip select are bits 14 & 13 */ |
339 | ((block_page >> 1) & 3) : | 338 | ((block_page >> 1) & 3) : |
340 | edac_mc_find_csrow_by_page(mci, block_page); | 339 | edac_mc_find_csrow_by_page(mci, block_page); |
341 | 340 | ||
342 | /* e752x mc reads 34:6 of the DRAM linear address */ | 341 | /* e752x mc reads 34:6 of the DRAM linear address */ |
343 | edac_mc_handle_ue(mci, block_page, | 342 | edac_mc_handle_ue(mci, block_page, |
344 | offset_in_page(error_2b << 4), | 343 | offset_in_page(error_2b << 4), |
345 | row, "e752x UE from Scruber"); | 344 | row, "e752x UE from Scruber"); |
346 | } | 345 | } |
347 | } | 346 | } |
348 | 347 | ||
349 | static inline void process_ue(struct mem_ctl_info *mci, u16 error_one, | 348 | static inline void process_ue(struct mem_ctl_info *mci, u16 error_one, |
350 | u32 ded_add, u32 scrb_add, int *error_found, int handle_error) | 349 | u32 ded_add, u32 scrb_add, int *error_found, |
350 | int handle_error) | ||
351 | { | 351 | { |
352 | *error_found = 1; | 352 | *error_found = 1; |
353 | 353 | ||
@@ -356,7 +356,7 @@ static inline void process_ue(struct mem_ctl_info *mci, u16 error_one, | |||
356 | } | 356 | } |
357 | 357 | ||
358 | static inline void process_ue_no_info_wr(struct mem_ctl_info *mci, | 358 | static inline void process_ue_no_info_wr(struct mem_ctl_info *mci, |
359 | int *error_found, int handle_error) | 359 | int *error_found, int handle_error) |
360 | { | 360 | { |
361 | *error_found = 1; | 361 | *error_found = 1; |
362 | 362 | ||
@@ -368,24 +368,24 @@ static inline void process_ue_no_info_wr(struct mem_ctl_info *mci, | |||
368 | } | 368 | } |
369 | 369 | ||
370 | static void do_process_ded_retry(struct mem_ctl_info *mci, u16 error, | 370 | static void do_process_ded_retry(struct mem_ctl_info *mci, u16 error, |
371 | u32 retry_add) | 371 | u32 retry_add) |
372 | { | 372 | { |
373 | u32 error_1b, page; | 373 | u32 error_1b, page; |
374 | int row; | 374 | int row; |
375 | struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info; | 375 | struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info; |
376 | 376 | ||
377 | error_1b = retry_add; | 377 | error_1b = retry_add; |
378 | page = error_1b >> (PAGE_SHIFT - 4); /* convert the addr to 4k page */ | 378 | page = error_1b >> (PAGE_SHIFT - 4); /* convert the addr to 4k page */ |
379 | row = pvt->mc_symmetric ? | 379 | row = pvt->mc_symmetric ? ((page >> 1) & 3) : /* chip select are bits 14 & 13 */ |
380 | ((page >> 1) & 3) : /* chip select are bits 14 & 13 */ | 380 | edac_mc_find_csrow_by_page(mci, page); |
381 | edac_mc_find_csrow_by_page(mci, page); | ||
382 | e752x_mc_printk(mci, KERN_WARNING, | 381 | e752x_mc_printk(mci, KERN_WARNING, |
383 | "CE page 0x%lx, row %d : Memory read retry\n", | 382 | "CE page 0x%lx, row %d : Memory read retry\n", |
384 | (long unsigned int) page, row); | 383 | (long unsigned int)page, row); |
385 | } | 384 | } |
386 | 385 | ||
387 | static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error, | 386 | static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error, |
388 | u32 retry_add, int *error_found, int handle_error) | 387 | u32 retry_add, int *error_found, |
388 | int handle_error) | ||
389 | { | 389 | { |
390 | *error_found = 1; | 390 | *error_found = 1; |
391 | 391 | ||
@@ -394,7 +394,7 @@ static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error, | |||
394 | } | 394 | } |
395 | 395 | ||
396 | static inline void process_threshold_ce(struct mem_ctl_info *mci, u16 error, | 396 | static inline void process_threshold_ce(struct mem_ctl_info *mci, u16 error, |
397 | int *error_found, int handle_error) | 397 | int *error_found, int handle_error) |
398 | { | 398 | { |
399 | *error_found = 1; | 399 | *error_found = 1; |
400 | 400 | ||
@@ -418,12 +418,12 @@ static void do_global_error(int fatal, u32 errors) | |||
418 | for (i = 0; i < 11; i++) { | 418 | for (i = 0; i < 11; i++) { |
419 | if (errors & (1 << i)) | 419 | if (errors & (1 << i)) |
420 | e752x_printk(KERN_WARNING, "%sError %s\n", | 420 | e752x_printk(KERN_WARNING, "%sError %s\n", |
421 | fatal_message[fatal], global_message[i]); | 421 | fatal_message[fatal], global_message[i]); |
422 | } | 422 | } |
423 | } | 423 | } |
424 | 424 | ||
425 | static inline void global_error(int fatal, u32 errors, int *error_found, | 425 | static inline void global_error(int fatal, u32 errors, int *error_found, |
426 | int handle_error) | 426 | int handle_error) |
427 | { | 427 | { |
428 | *error_found = 1; | 428 | *error_found = 1; |
429 | 429 | ||
@@ -445,12 +445,12 @@ static void do_hub_error(int fatal, u8 errors) | |||
445 | for (i = 0; i < 7; i++) { | 445 | for (i = 0; i < 7; i++) { |
446 | if (errors & (1 << i)) | 446 | if (errors & (1 << i)) |
447 | e752x_printk(KERN_WARNING, "%sError %s\n", | 447 | e752x_printk(KERN_WARNING, "%sError %s\n", |
448 | fatal_message[fatal], hub_message[i]); | 448 | fatal_message[fatal], hub_message[i]); |
449 | } | 449 | } |
450 | } | 450 | } |
451 | 451 | ||
452 | static inline void hub_error(int fatal, u8 errors, int *error_found, | 452 | static inline void hub_error(int fatal, u8 errors, int *error_found, |
453 | int handle_error) | 453 | int handle_error) |
454 | { | 454 | { |
455 | *error_found = 1; | 455 | *error_found = 1; |
456 | 456 | ||
@@ -472,7 +472,7 @@ static void do_membuf_error(u8 errors) | |||
472 | for (i = 0; i < 4; i++) { | 472 | for (i = 0; i < 4; i++) { |
473 | if (errors & (1 << i)) | 473 | if (errors & (1 << i)) |
474 | e752x_printk(KERN_WARNING, "Non-Fatal Error %s\n", | 474 | e752x_printk(KERN_WARNING, "Non-Fatal Error %s\n", |
475 | membuf_message[i]); | 475 | membuf_message[i]); |
476 | } | 476 | } |
477 | } | 477 | } |
478 | 478 | ||
@@ -503,12 +503,12 @@ static void do_sysbus_error(int fatal, u32 errors) | |||
503 | for (i = 0; i < 10; i++) { | 503 | for (i = 0; i < 10; i++) { |
504 | if (errors & (1 << i)) | 504 | if (errors & (1 << i)) |
505 | e752x_printk(KERN_WARNING, "%sError System Bus %s\n", | 505 | e752x_printk(KERN_WARNING, "%sError System Bus %s\n", |
506 | fatal_message[fatal], sysbus_message[i]); | 506 | fatal_message[fatal], sysbus_message[i]); |
507 | } | 507 | } |
508 | } | 508 | } |
509 | 509 | ||
510 | static inline void sysbus_error(int fatal, u32 errors, int *error_found, | 510 | static inline void sysbus_error(int fatal, u32 errors, int *error_found, |
511 | int handle_error) | 511 | int handle_error) |
512 | { | 512 | { |
513 | *error_found = 1; | 513 | *error_found = 1; |
514 | 514 | ||
@@ -517,7 +517,7 @@ static inline void sysbus_error(int fatal, u32 errors, int *error_found, | |||
517 | } | 517 | } |
518 | 518 | ||
519 | static void e752x_check_hub_interface(struct e752x_error_info *info, | 519 | static void e752x_check_hub_interface(struct e752x_error_info *info, |
520 | int *error_found, int handle_error) | 520 | int *error_found, int handle_error) |
521 | { | 521 | { |
522 | u8 stat8; | 522 | u8 stat8; |
523 | 523 | ||
@@ -525,33 +525,32 @@ static void e752x_check_hub_interface(struct e752x_error_info *info, | |||
525 | 525 | ||
526 | stat8 = info->hi_ferr; | 526 | stat8 = info->hi_ferr; |
527 | 527 | ||
528 | if(stat8 & 0x7f) { /* Error, so process */ | 528 | if (stat8 & 0x7f) { /* Error, so process */ |
529 | stat8 &= 0x7f; | 529 | stat8 &= 0x7f; |
530 | 530 | ||
531 | if(stat8 & 0x2b) | 531 | if (stat8 & 0x2b) |
532 | hub_error(1, stat8 & 0x2b, error_found, handle_error); | 532 | hub_error(1, stat8 & 0x2b, error_found, handle_error); |
533 | 533 | ||
534 | if(stat8 & 0x54) | 534 | if (stat8 & 0x54) |
535 | hub_error(0, stat8 & 0x54, error_found, handle_error); | 535 | hub_error(0, stat8 & 0x54, error_found, handle_error); |
536 | } | 536 | } |
537 | |||
538 | //pci_read_config_byte(dev,E752X_HI_NERR,&stat8); | 537 | //pci_read_config_byte(dev,E752X_HI_NERR,&stat8); |
539 | 538 | ||
540 | stat8 = info->hi_nerr; | 539 | stat8 = info->hi_nerr; |
541 | 540 | ||
542 | if(stat8 & 0x7f) { /* Error, so process */ | 541 | if (stat8 & 0x7f) { /* Error, so process */ |
543 | stat8 &= 0x7f; | 542 | stat8 &= 0x7f; |
544 | 543 | ||
545 | if (stat8 & 0x2b) | 544 | if (stat8 & 0x2b) |
546 | hub_error(1, stat8 & 0x2b, error_found, handle_error); | 545 | hub_error(1, stat8 & 0x2b, error_found, handle_error); |
547 | 546 | ||
548 | if(stat8 & 0x54) | 547 | if (stat8 & 0x54) |
549 | hub_error(0, stat8 & 0x54, error_found, handle_error); | 548 | hub_error(0, stat8 & 0x54, error_found, handle_error); |
550 | } | 549 | } |
551 | } | 550 | } |
552 | 551 | ||
553 | static void e752x_check_sysbus(struct e752x_error_info *info, | 552 | static void e752x_check_sysbus(struct e752x_error_info *info, |
554 | int *error_found, int handle_error) | 553 | int *error_found, int handle_error) |
555 | { | 554 | { |
556 | u32 stat32, error32; | 555 | u32 stat32, error32; |
557 | 556 | ||
@@ -559,47 +558,47 @@ static void e752x_check_sysbus(struct e752x_error_info *info, | |||
559 | stat32 = info->sysbus_ferr + (info->sysbus_nerr << 16); | 558 | stat32 = info->sysbus_ferr + (info->sysbus_nerr << 16); |
560 | 559 | ||
561 | if (stat32 == 0) | 560 | if (stat32 == 0) |
562 | return; /* no errors */ | 561 | return; /* no errors */ |
563 | 562 | ||
564 | error32 = (stat32 >> 16) & 0x3ff; | 563 | error32 = (stat32 >> 16) & 0x3ff; |
565 | stat32 = stat32 & 0x3ff; | 564 | stat32 = stat32 & 0x3ff; |
566 | 565 | ||
567 | if(stat32 & 0x087) | 566 | if (stat32 & 0x087) |
568 | sysbus_error(1, stat32 & 0x087, error_found, handle_error); | 567 | sysbus_error(1, stat32 & 0x087, error_found, handle_error); |
569 | 568 | ||
570 | if(stat32 & 0x378) | 569 | if (stat32 & 0x378) |
571 | sysbus_error(0, stat32 & 0x378, error_found, handle_error); | 570 | sysbus_error(0, stat32 & 0x378, error_found, handle_error); |
572 | 571 | ||
573 | if(error32 & 0x087) | 572 | if (error32 & 0x087) |
574 | sysbus_error(1, error32 & 0x087, error_found, handle_error); | 573 | sysbus_error(1, error32 & 0x087, error_found, handle_error); |
575 | 574 | ||
576 | if(error32 & 0x378) | 575 | if (error32 & 0x378) |
577 | sysbus_error(0, error32 & 0x378, error_found, handle_error); | 576 | sysbus_error(0, error32 & 0x378, error_found, handle_error); |
578 | } | 577 | } |
579 | 578 | ||
580 | static void e752x_check_membuf (struct e752x_error_info *info, | 579 | static void e752x_check_membuf(struct e752x_error_info *info, |
581 | int *error_found, int handle_error) | 580 | int *error_found, int handle_error) |
582 | { | 581 | { |
583 | u8 stat8; | 582 | u8 stat8; |
584 | 583 | ||
585 | stat8 = info->buf_ferr; | 584 | stat8 = info->buf_ferr; |
586 | 585 | ||
587 | if (stat8 & 0x0f) { /* Error, so process */ | 586 | if (stat8 & 0x0f) { /* Error, so process */ |
588 | stat8 &= 0x0f; | 587 | stat8 &= 0x0f; |
589 | membuf_error(stat8, error_found, handle_error); | 588 | membuf_error(stat8, error_found, handle_error); |
590 | } | 589 | } |
591 | 590 | ||
592 | stat8 = info->buf_nerr; | 591 | stat8 = info->buf_nerr; |
593 | 592 | ||
594 | if (stat8 & 0x0f) { /* Error, so process */ | 593 | if (stat8 & 0x0f) { /* Error, so process */ |
595 | stat8 &= 0x0f; | 594 | stat8 &= 0x0f; |
596 | membuf_error(stat8, error_found, handle_error); | 595 | membuf_error(stat8, error_found, handle_error); |
597 | } | 596 | } |
598 | } | 597 | } |
599 | 598 | ||
600 | static void e752x_check_dram (struct mem_ctl_info *mci, | 599 | static void e752x_check_dram(struct mem_ctl_info *mci, |
601 | struct e752x_error_info *info, int *error_found, | 600 | struct e752x_error_info *info, int *error_found, |
602 | int handle_error) | 601 | int handle_error) |
603 | { | 602 | { |
604 | u16 error_one, error_next; | 603 | u16 error_one, error_next; |
605 | 604 | ||
@@ -607,94 +606,90 @@ static void e752x_check_dram (struct mem_ctl_info *mci, | |||
607 | error_next = info->dram_nerr; | 606 | error_next = info->dram_nerr; |
608 | 607 | ||
609 | /* decode and report errors */ | 608 | /* decode and report errors */ |
610 | if(error_one & 0x0101) /* check first error correctable */ | 609 | if (error_one & 0x0101) /* check first error correctable */ |
611 | process_ce(mci, error_one, info->dram_sec1_add, | 610 | process_ce(mci, error_one, info->dram_sec1_add, |
612 | info->dram_sec1_syndrome, error_found, | 611 | info->dram_sec1_syndrome, error_found, handle_error); |
613 | handle_error); | ||
614 | 612 | ||
615 | if(error_next & 0x0101) /* check next error correctable */ | 613 | if (error_next & 0x0101) /* check next error correctable */ |
616 | process_ce(mci, error_next, info->dram_sec2_add, | 614 | process_ce(mci, error_next, info->dram_sec2_add, |
617 | info->dram_sec2_syndrome, error_found, | 615 | info->dram_sec2_syndrome, error_found, handle_error); |
618 | handle_error); | ||
619 | 616 | ||
620 | if(error_one & 0x4040) | 617 | if (error_one & 0x4040) |
621 | process_ue_no_info_wr(mci, error_found, handle_error); | 618 | process_ue_no_info_wr(mci, error_found, handle_error); |
622 | 619 | ||
623 | if(error_next & 0x4040) | 620 | if (error_next & 0x4040) |
624 | process_ue_no_info_wr(mci, error_found, handle_error); | 621 | process_ue_no_info_wr(mci, error_found, handle_error); |
625 | 622 | ||
626 | if(error_one & 0x2020) | 623 | if (error_one & 0x2020) |
627 | process_ded_retry(mci, error_one, info->dram_retr_add, | 624 | process_ded_retry(mci, error_one, info->dram_retr_add, |
628 | error_found, handle_error); | 625 | error_found, handle_error); |
629 | 626 | ||
630 | if(error_next & 0x2020) | 627 | if (error_next & 0x2020) |
631 | process_ded_retry(mci, error_next, info->dram_retr_add, | 628 | process_ded_retry(mci, error_next, info->dram_retr_add, |
632 | error_found, handle_error); | 629 | error_found, handle_error); |
633 | 630 | ||
634 | if(error_one & 0x0808) | 631 | if (error_one & 0x0808) |
635 | process_threshold_ce(mci, error_one, error_found, | 632 | process_threshold_ce(mci, error_one, error_found, handle_error); |
636 | handle_error); | ||
637 | 633 | ||
638 | if(error_next & 0x0808) | 634 | if (error_next & 0x0808) |
639 | process_threshold_ce(mci, error_next, error_found, | 635 | process_threshold_ce(mci, error_next, error_found, |
640 | handle_error); | 636 | handle_error); |
641 | 637 | ||
642 | if(error_one & 0x0606) | 638 | if (error_one & 0x0606) |
643 | process_ue(mci, error_one, info->dram_ded_add, | 639 | process_ue(mci, error_one, info->dram_ded_add, |
644 | info->dram_scrb_add, error_found, handle_error); | 640 | info->dram_scrb_add, error_found, handle_error); |
645 | 641 | ||
646 | if(error_next & 0x0606) | 642 | if (error_next & 0x0606) |
647 | process_ue(mci, error_next, info->dram_ded_add, | 643 | process_ue(mci, error_next, info->dram_ded_add, |
648 | info->dram_scrb_add, error_found, handle_error); | 644 | info->dram_scrb_add, error_found, handle_error); |
649 | } | 645 | } |
650 | 646 | ||
651 | static void e752x_get_error_info (struct mem_ctl_info *mci, | 647 | static void e752x_get_error_info(struct mem_ctl_info *mci, |
652 | struct e752x_error_info *info) | 648 | struct e752x_error_info *info) |
653 | { | 649 | { |
654 | struct pci_dev *dev; | 650 | struct pci_dev *dev; |
655 | struct e752x_pvt *pvt; | 651 | struct e752x_pvt *pvt; |
656 | 652 | ||
657 | memset(info, 0, sizeof(*info)); | 653 | memset(info, 0, sizeof(*info)); |
658 | pvt = (struct e752x_pvt *) mci->pvt_info; | 654 | pvt = (struct e752x_pvt *)mci->pvt_info; |
659 | dev = pvt->dev_d0f1; | 655 | dev = pvt->dev_d0f1; |
660 | pci_read_config_dword(dev, E752X_FERR_GLOBAL, &info->ferr_global); | 656 | pci_read_config_dword(dev, E752X_FERR_GLOBAL, &info->ferr_global); |
661 | 657 | ||
662 | if (info->ferr_global) { | 658 | if (info->ferr_global) { |
663 | pci_read_config_byte(dev, E752X_HI_FERR, &info->hi_ferr); | 659 | pci_read_config_byte(dev, E752X_HI_FERR, &info->hi_ferr); |
664 | pci_read_config_word(dev, E752X_SYSBUS_FERR, | 660 | pci_read_config_word(dev, E752X_SYSBUS_FERR, |
665 | &info->sysbus_ferr); | 661 | &info->sysbus_ferr); |
666 | pci_read_config_byte(dev, E752X_BUF_FERR, &info->buf_ferr); | 662 | pci_read_config_byte(dev, E752X_BUF_FERR, &info->buf_ferr); |
667 | pci_read_config_word(dev, E752X_DRAM_FERR, | 663 | pci_read_config_word(dev, E752X_DRAM_FERR, &info->dram_ferr); |
668 | &info->dram_ferr); | ||
669 | pci_read_config_dword(dev, E752X_DRAM_SEC1_ADD, | 664 | pci_read_config_dword(dev, E752X_DRAM_SEC1_ADD, |
670 | &info->dram_sec1_add); | 665 | &info->dram_sec1_add); |
671 | pci_read_config_word(dev, E752X_DRAM_SEC1_SYNDROME, | 666 | pci_read_config_word(dev, E752X_DRAM_SEC1_SYNDROME, |
672 | &info->dram_sec1_syndrome); | 667 | &info->dram_sec1_syndrome); |
673 | pci_read_config_dword(dev, E752X_DRAM_DED_ADD, | 668 | pci_read_config_dword(dev, E752X_DRAM_DED_ADD, |
674 | &info->dram_ded_add); | 669 | &info->dram_ded_add); |
675 | pci_read_config_dword(dev, E752X_DRAM_SCRB_ADD, | 670 | pci_read_config_dword(dev, E752X_DRAM_SCRB_ADD, |
676 | &info->dram_scrb_add); | 671 | &info->dram_scrb_add); |
677 | pci_read_config_dword(dev, E752X_DRAM_RETR_ADD, | 672 | pci_read_config_dword(dev, E752X_DRAM_RETR_ADD, |
678 | &info->dram_retr_add); | 673 | &info->dram_retr_add); |
679 | 674 | ||
680 | if (info->hi_ferr & 0x7f) | 675 | if (info->hi_ferr & 0x7f) |
681 | pci_write_config_byte(dev, E752X_HI_FERR, | 676 | pci_write_config_byte(dev, E752X_HI_FERR, |
682 | info->hi_ferr); | 677 | info->hi_ferr); |
683 | 678 | ||
684 | if (info->sysbus_ferr) | 679 | if (info->sysbus_ferr) |
685 | pci_write_config_word(dev, E752X_SYSBUS_FERR, | 680 | pci_write_config_word(dev, E752X_SYSBUS_FERR, |
686 | info->sysbus_ferr); | 681 | info->sysbus_ferr); |
687 | 682 | ||
688 | if (info->buf_ferr & 0x0f) | 683 | if (info->buf_ferr & 0x0f) |
689 | pci_write_config_byte(dev, E752X_BUF_FERR, | 684 | pci_write_config_byte(dev, E752X_BUF_FERR, |
690 | info->buf_ferr); | 685 | info->buf_ferr); |
691 | 686 | ||
692 | if (info->dram_ferr) | 687 | if (info->dram_ferr) |
693 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_FERR, | 688 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_FERR, |
694 | info->dram_ferr, info->dram_ferr); | 689 | info->dram_ferr, info->dram_ferr); |
695 | 690 | ||
696 | pci_write_config_dword(dev, E752X_FERR_GLOBAL, | 691 | pci_write_config_dword(dev, E752X_FERR_GLOBAL, |
697 | info->ferr_global); | 692 | info->ferr_global); |
698 | } | 693 | } |
699 | 694 | ||
700 | pci_read_config_dword(dev, E752X_NERR_GLOBAL, &info->nerr_global); | 695 | pci_read_config_dword(dev, E752X_NERR_GLOBAL, &info->nerr_global); |
@@ -702,38 +697,38 @@ static void e752x_get_error_info (struct mem_ctl_info *mci, | |||
702 | if (info->nerr_global) { | 697 | if (info->nerr_global) { |
703 | pci_read_config_byte(dev, E752X_HI_NERR, &info->hi_nerr); | 698 | pci_read_config_byte(dev, E752X_HI_NERR, &info->hi_nerr); |
704 | pci_read_config_word(dev, E752X_SYSBUS_NERR, | 699 | pci_read_config_word(dev, E752X_SYSBUS_NERR, |
705 | &info->sysbus_nerr); | 700 | &info->sysbus_nerr); |
706 | pci_read_config_byte(dev, E752X_BUF_NERR, &info->buf_nerr); | 701 | pci_read_config_byte(dev, E752X_BUF_NERR, &info->buf_nerr); |
707 | pci_read_config_word(dev, E752X_DRAM_NERR, | 702 | pci_read_config_word(dev, E752X_DRAM_NERR, &info->dram_nerr); |
708 | &info->dram_nerr); | ||
709 | pci_read_config_dword(dev, E752X_DRAM_SEC2_ADD, | 703 | pci_read_config_dword(dev, E752X_DRAM_SEC2_ADD, |
710 | &info->dram_sec2_add); | 704 | &info->dram_sec2_add); |
711 | pci_read_config_word(dev, E752X_DRAM_SEC2_SYNDROME, | 705 | pci_read_config_word(dev, E752X_DRAM_SEC2_SYNDROME, |
712 | &info->dram_sec2_syndrome); | 706 | &info->dram_sec2_syndrome); |
713 | 707 | ||
714 | if (info->hi_nerr & 0x7f) | 708 | if (info->hi_nerr & 0x7f) |
715 | pci_write_config_byte(dev, E752X_HI_NERR, | 709 | pci_write_config_byte(dev, E752X_HI_NERR, |
716 | info->hi_nerr); | 710 | info->hi_nerr); |
717 | 711 | ||
718 | if (info->sysbus_nerr) | 712 | if (info->sysbus_nerr) |
719 | pci_write_config_word(dev, E752X_SYSBUS_NERR, | 713 | pci_write_config_word(dev, E752X_SYSBUS_NERR, |
720 | info->sysbus_nerr); | 714 | info->sysbus_nerr); |
721 | 715 | ||
722 | if (info->buf_nerr & 0x0f) | 716 | if (info->buf_nerr & 0x0f) |
723 | pci_write_config_byte(dev, E752X_BUF_NERR, | 717 | pci_write_config_byte(dev, E752X_BUF_NERR, |
724 | info->buf_nerr); | 718 | info->buf_nerr); |
725 | 719 | ||
726 | if (info->dram_nerr) | 720 | if (info->dram_nerr) |
727 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_NERR, | 721 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_NERR, |
728 | info->dram_nerr, info->dram_nerr); | 722 | info->dram_nerr, info->dram_nerr); |
729 | 723 | ||
730 | pci_write_config_dword(dev, E752X_NERR_GLOBAL, | 724 | pci_write_config_dword(dev, E752X_NERR_GLOBAL, |
731 | info->nerr_global); | 725 | info->nerr_global); |
732 | } | 726 | } |
733 | } | 727 | } |
734 | 728 | ||
735 | static int e752x_process_error_info (struct mem_ctl_info *mci, | 729 | static int e752x_process_error_info(struct mem_ctl_info *mci, |
736 | struct e752x_error_info *info, int handle_errors) | 730 | struct e752x_error_info *info, |
731 | int handle_errors) | ||
737 | { | 732 | { |
738 | u32 error32, stat32; | 733 | u32 error32, stat32; |
739 | int error_found; | 734 | int error_found; |
@@ -780,25 +775,25 @@ static inline int dual_channel_active(u16 ddrcsr) | |||
780 | } | 775 | } |
781 | 776 | ||
782 | static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, | 777 | static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, |
783 | u16 ddrcsr) | 778 | u16 ddrcsr) |
784 | { | 779 | { |
785 | struct csrow_info *csrow; | 780 | struct csrow_info *csrow; |
786 | unsigned long last_cumul_size; | 781 | unsigned long last_cumul_size; |
787 | int index, mem_dev, drc_chan; | 782 | int index, mem_dev, drc_chan; |
788 | int drc_drbg; /* DRB granularity 0=64mb, 1=128mb */ | 783 | int drc_drbg; /* DRB granularity 0=64mb, 1=128mb */ |
789 | int drc_ddim; /* DRAM Data Integrity Mode 0=none, 2=edac */ | 784 | int drc_ddim; /* DRAM Data Integrity Mode 0=none, 2=edac */ |
790 | u8 value; | 785 | u8 value; |
791 | u32 dra, drc, cumul_size; | 786 | u32 dra, drc, cumul_size; |
792 | 787 | ||
793 | dra = 0; | 788 | dra = 0; |
794 | for (index=0; index < 4; index++) { | 789 | for (index = 0; index < 4; index++) { |
795 | u8 dra_reg; | 790 | u8 dra_reg; |
796 | pci_read_config_byte(pdev, E752X_DRA+index, &dra_reg); | 791 | pci_read_config_byte(pdev, E752X_DRA + index, &dra_reg); |
797 | dra |= dra_reg << (index * 8); | 792 | dra |= dra_reg << (index * 8); |
798 | } | 793 | } |
799 | pci_read_config_dword(pdev, E752X_DRC, &drc); | 794 | pci_read_config_dword(pdev, E752X_DRC, &drc); |
800 | drc_chan = dual_channel_active(ddrcsr); | 795 | drc_chan = dual_channel_active(ddrcsr); |
801 | drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */ | 796 | drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */ |
802 | drc_ddim = (drc >> 20) & 0x3; | 797 | drc_ddim = (drc >> 20) & 0x3; |
803 | 798 | ||
804 | /* The dram row boundary (DRB) reg values are boundary address for | 799 | /* The dram row boundary (DRB) reg values are boundary address for |
@@ -846,7 +841,7 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, | |||
846 | } | 841 | } |
847 | 842 | ||
848 | static void e752x_init_mem_map_table(struct pci_dev *pdev, | 843 | static void e752x_init_mem_map_table(struct pci_dev *pdev, |
849 | struct e752x_pvt *pvt) | 844 | struct e752x_pvt *pvt) |
850 | { | 845 | { |
851 | int index; | 846 | int index; |
852 | u8 value, last, row, stat8; | 847 | u8 value, last, row, stat8; |
@@ -861,7 +856,7 @@ static void e752x_init_mem_map_table(struct pci_dev *pdev, | |||
861 | /* no dimm in the slot, so flag it as empty */ | 856 | /* no dimm in the slot, so flag it as empty */ |
862 | pvt->map[index] = 0xff; | 857 | pvt->map[index] = 0xff; |
863 | pvt->map[index + 1] = 0xff; | 858 | pvt->map[index + 1] = 0xff; |
864 | } else { /* there is a dimm in the slot */ | 859 | } else { /* there is a dimm in the slot */ |
865 | pvt->map[index] = row; | 860 | pvt->map[index] = row; |
866 | row++; | 861 | row++; |
867 | last = value; | 862 | last = value; |
@@ -870,10 +865,9 @@ static void e752x_init_mem_map_table(struct pci_dev *pdev, | |||
870 | */ | 865 | */ |
871 | pci_read_config_byte(pdev, E752X_DRB + index + 1, | 866 | pci_read_config_byte(pdev, E752X_DRB + index + 1, |
872 | &value); | 867 | &value); |
873 | pvt->map[index + 1] = (value == last) ? | 868 | pvt->map[index + 1] = (value == last) ? 0xff : /* the dimm is single sided, |
874 | 0xff : /* the dimm is single sided, | 869 | so flag as empty */ |
875 | so flag as empty */ | 870 | row; /* this is a double sided dimm |
876 | row; /* this is a double sided dimm | ||
877 | to save the next row # */ | 871 | to save the next row # */ |
878 | row++; | 872 | row++; |
879 | last = value; | 873 | last = value; |
@@ -887,13 +881,12 @@ static void e752x_init_mem_map_table(struct pci_dev *pdev, | |||
887 | 881 | ||
888 | /* Return 0 on success or 1 on failure. */ | 882 | /* Return 0 on success or 1 on failure. */ |
889 | static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, | 883 | static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, |
890 | struct e752x_pvt *pvt) | 884 | struct e752x_pvt *pvt) |
891 | { | 885 | { |
892 | struct pci_dev *dev; | 886 | struct pci_dev *dev; |
893 | 887 | ||
894 | pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, | 888 | pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, |
895 | pvt->dev_info->err_dev, | 889 | pvt->dev_info->err_dev, pvt->bridge_ck); |
896 | pvt->bridge_ck); | ||
897 | 890 | ||
898 | if (pvt->bridge_ck == NULL) | 891 | if (pvt->bridge_ck == NULL) |
899 | pvt->bridge_ck = pci_scan_single_device(pdev->bus, | 892 | pvt->bridge_ck = pci_scan_single_device(pdev->bus, |
@@ -901,8 +894,8 @@ static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, | |||
901 | 894 | ||
902 | if (pvt->bridge_ck == NULL) { | 895 | if (pvt->bridge_ck == NULL) { |
903 | e752x_printk(KERN_ERR, "error reporting device not found:" | 896 | e752x_printk(KERN_ERR, "error reporting device not found:" |
904 | "vendor %x device 0x%x (broken BIOS?)\n", | 897 | "vendor %x device 0x%x (broken BIOS?)\n", |
905 | PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); | 898 | PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); |
906 | return 1; | 899 | return 1; |
907 | } | 900 | } |
908 | 901 | ||
@@ -917,7 +910,7 @@ static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, | |||
917 | 910 | ||
918 | return 0; | 911 | return 0; |
919 | 912 | ||
920 | fail: | 913 | fail: |
921 | pci_dev_put(pvt->bridge_ck); | 914 | pci_dev_put(pvt->bridge_ck); |
922 | return 1; | 915 | return 1; |
923 | } | 916 | } |
@@ -945,20 +938,20 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
945 | struct mem_ctl_info *mci; | 938 | struct mem_ctl_info *mci; |
946 | struct e752x_pvt *pvt; | 939 | struct e752x_pvt *pvt; |
947 | u16 ddrcsr; | 940 | u16 ddrcsr; |
948 | int drc_chan; /* Number of channels 0=1chan,1=2chan */ | 941 | int drc_chan; /* Number of channels 0=1chan,1=2chan */ |
949 | struct e752x_error_info discard; | 942 | struct e752x_error_info discard; |
950 | 943 | ||
951 | debugf0("%s(): mci\n", __func__); | 944 | debugf0("%s(): mci\n", __func__); |
952 | debugf0("Starting Probe1\n"); | 945 | debugf0("Starting Probe1\n"); |
953 | 946 | ||
954 | /* make sure error reporting method is sane */ | 947 | /* make sure error reporting method is sane */ |
955 | switch(edac_op_state) { | 948 | switch (edac_op_state) { |
956 | case EDAC_OPSTATE_POLL: | 949 | case EDAC_OPSTATE_POLL: |
957 | case EDAC_OPSTATE_NMI: | 950 | case EDAC_OPSTATE_NMI: |
958 | break; | 951 | break; |
959 | default: | 952 | default: |
960 | edac_op_state = EDAC_OPSTATE_POLL; | 953 | edac_op_state = EDAC_OPSTATE_POLL; |
961 | break; | 954 | break; |
962 | } | 955 | } |
963 | 956 | ||
964 | /* check to see if device 0 function 1 is enabled; if it isn't, we | 957 | /* check to see if device 0 function 1 is enabled; if it isn't, we |
@@ -968,7 +961,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
968 | pci_read_config_byte(pdev, E752X_DEVPRES1, &stat8); | 961 | pci_read_config_byte(pdev, E752X_DEVPRES1, &stat8); |
969 | if (!force_function_unhide && !(stat8 & (1 << 5))) { | 962 | if (!force_function_unhide && !(stat8 & (1 << 5))) { |
970 | printk(KERN_INFO "Contact your BIOS vendor to see if the " | 963 | printk(KERN_INFO "Contact your BIOS vendor to see if the " |
971 | "E752x error registers can be safely un-hidden\n"); | 964 | "E752x error registers can be safely un-hidden\n"); |
972 | return -ENOMEM; | 965 | return -ENOMEM; |
973 | } | 966 | } |
974 | stat8 |= (1 << 5); | 967 | stat8 |= (1 << 5); |
@@ -995,7 +988,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
995 | mci->dev = &pdev->dev; | 988 | mci->dev = &pdev->dev; |
996 | 989 | ||
997 | debugf3("%s(): init pvt\n", __func__); | 990 | debugf3("%s(): init pvt\n", __func__); |
998 | pvt = (struct e752x_pvt *) mci->pvt_info; | 991 | pvt = (struct e752x_pvt *)mci->pvt_info; |
999 | pvt->dev_info = &e752x_devs[dev_idx]; | 992 | pvt->dev_info = &e752x_devs[dev_idx]; |
1000 | pvt->mc_symmetric = ((ddrcsr & 0x10) != 0); | 993 | pvt->mc_symmetric = ((ddrcsr & 0x10) != 0); |
1001 | 994 | ||
@@ -1028,36 +1021,34 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
1028 | pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data); | 1021 | pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data); |
1029 | pvt->remaplimit = ((u32) pci_data) << 14; | 1022 | pvt->remaplimit = ((u32) pci_data) << 14; |
1030 | e752x_printk(KERN_INFO, | 1023 | e752x_printk(KERN_INFO, |
1031 | "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, | 1024 | "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, |
1032 | pvt->remapbase, pvt->remaplimit); | 1025 | pvt->remapbase, pvt->remaplimit); |
1033 | 1026 | ||
1034 | /* Here we assume that we will never see multiple instances of this | 1027 | /* Here we assume that we will never see multiple instances of this |
1035 | * type of memory controller. The ID is therefore hardcoded to 0. | 1028 | * type of memory controller. The ID is therefore hardcoded to 0. |
1036 | */ | 1029 | */ |
1037 | if (edac_mc_add_mc(mci,0)) { | 1030 | if (edac_mc_add_mc(mci, 0)) { |
1038 | debugf3("%s(): failed edac_mc_add_mc()\n", __func__); | 1031 | debugf3("%s(): failed edac_mc_add_mc()\n", __func__); |
1039 | goto fail; | 1032 | goto fail; |
1040 | } | 1033 | } |
1041 | 1034 | ||
1042 | e752x_init_error_reporting_regs(pvt); | 1035 | e752x_init_error_reporting_regs(pvt); |
1043 | e752x_get_error_info(mci, &discard); /* clear other MCH errors */ | 1036 | e752x_get_error_info(mci, &discard); /* clear other MCH errors */ |
1044 | 1037 | ||
1045 | /* allocating generic PCI control info */ | 1038 | /* allocating generic PCI control info */ |
1046 | e752x_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR); | 1039 | e752x_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR); |
1047 | if (!e752x_pci) { | 1040 | if (!e752x_pci) { |
1048 | printk(KERN_WARNING | 1041 | printk(KERN_WARNING |
1049 | "%s(): Unable to create PCI control\n", | 1042 | "%s(): Unable to create PCI control\n", __func__); |
1050 | __func__); | ||
1051 | printk(KERN_WARNING | 1043 | printk(KERN_WARNING |
1052 | "%s(): PCI error report via EDAC not setup\n", | 1044 | "%s(): PCI error report via EDAC not setup\n", __func__); |
1053 | __func__); | ||
1054 | } | 1045 | } |
1055 | 1046 | ||
1056 | /* get this far and it's successful */ | 1047 | /* get this far and it's successful */ |
1057 | debugf3("%s(): success\n", __func__); | 1048 | debugf3("%s(): success\n", __func__); |
1058 | return 0; | 1049 | return 0; |
1059 | 1050 | ||
1060 | fail: | 1051 | fail: |
1061 | pci_dev_put(pvt->dev_d0f0); | 1052 | pci_dev_put(pvt->dev_d0f0); |
1062 | pci_dev_put(pvt->dev_d0f1); | 1053 | pci_dev_put(pvt->dev_d0f1); |
1063 | pci_dev_put(pvt->bridge_ck); | 1054 | pci_dev_put(pvt->bridge_ck); |
@@ -1068,12 +1059,12 @@ fail: | |||
1068 | 1059 | ||
1069 | /* returns count (>= 0), or negative on error */ | 1060 | /* returns count (>= 0), or negative on error */ |
1070 | static int __devinit e752x_init_one(struct pci_dev *pdev, | 1061 | static int __devinit e752x_init_one(struct pci_dev *pdev, |
1071 | const struct pci_device_id *ent) | 1062 | const struct pci_device_id *ent) |
1072 | { | 1063 | { |
1073 | debugf0("%s()\n", __func__); | 1064 | debugf0("%s()\n", __func__); |
1074 | 1065 | ||
1075 | /* wake up and enable device */ | 1066 | /* wake up and enable device */ |
1076 | if(pci_enable_device(pdev) < 0) | 1067 | if (pci_enable_device(pdev) < 0) |
1077 | return -EIO; | 1068 | return -EIO; |
1078 | 1069 | ||
1079 | return e752x_probe1(pdev, ent->driver_data); | 1070 | return e752x_probe1(pdev, ent->driver_data); |
@@ -1092,7 +1083,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev) | |||
1092 | if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) | 1083 | if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) |
1093 | return; | 1084 | return; |
1094 | 1085 | ||
1095 | pvt = (struct e752x_pvt *) mci->pvt_info; | 1086 | pvt = (struct e752x_pvt *)mci->pvt_info; |
1096 | pci_dev_put(pvt->dev_d0f0); | 1087 | pci_dev_put(pvt->dev_d0f0); |
1097 | pci_dev_put(pvt->dev_d0f1); | 1088 | pci_dev_put(pvt->dev_d0f1); |
1098 | pci_dev_put(pvt->bridge_ck); | 1089 | pci_dev_put(pvt->bridge_ck); |
@@ -1101,20 +1092,17 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev) | |||
1101 | 1092 | ||
1102 | static const struct pci_device_id e752x_pci_tbl[] __devinitdata = { | 1093 | static const struct pci_device_id e752x_pci_tbl[] __devinitdata = { |
1103 | { | 1094 | { |
1104 | PCI_VEND_DEV(INTEL, 7520_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 1095 | PCI_VEND_DEV(INTEL, 7520_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
1105 | E7520 | 1096 | E7520}, |
1106 | }, | ||
1107 | { | 1097 | { |
1108 | PCI_VEND_DEV(INTEL, 7525_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 1098 | PCI_VEND_DEV(INTEL, 7525_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
1109 | E7525 | 1099 | E7525}, |
1110 | }, | ||
1111 | { | 1100 | { |
1112 | PCI_VEND_DEV(INTEL, 7320_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 1101 | PCI_VEND_DEV(INTEL, 7320_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
1113 | E7320 | 1102 | E7320}, |
1114 | }, | ||
1115 | { | 1103 | { |
1116 | 0, | 1104 | 0, |
1117 | } /* 0 terminated list. */ | 1105 | } /* 0 terminated list. */ |
1118 | }; | 1106 | }; |
1119 | 1107 | ||
1120 | MODULE_DEVICE_TABLE(pci, e752x_pci_tbl); | 1108 | MODULE_DEVICE_TABLE(pci, e752x_pci_tbl); |
@@ -1150,6 +1138,6 @@ MODULE_DESCRIPTION("MC support for Intel e752x memory controllers"); | |||
1150 | 1138 | ||
1151 | module_param(force_function_unhide, int, 0444); | 1139 | module_param(force_function_unhide, int, 0444); |
1152 | MODULE_PARM_DESC(force_function_unhide, "if BIOS sets Dev0:Fun1 up as hidden:" | 1140 | MODULE_PARM_DESC(force_function_unhide, "if BIOS sets Dev0:Fun1 up as hidden:" |
1153 | " 1=force unhide and hope BIOS doesn't fight driver for Dev0:Fun1 access"); | 1141 | " 1=force unhide and hope BIOS doesn't fight driver for Dev0:Fun1 access"); |
1154 | module_param(edac_op_state, int, 0444); | 1142 | module_param(edac_op_state, int, 0444); |
1155 | MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); | 1143 | MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); |