aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDave Peterson <dsp@llnl.gov>2006-03-26 04:38:40 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:57:06 -0500
commit537fba28928c01b7db1580627450691a4bb0b9b3 (patch)
tree1fd5adaa38ba639e28b56e014bfb309c0d1e181e /drivers
parentf2fe42abbf0d99a8c4b96f1cc55db10ac35d2fb9 (diff)
[PATCH] EDAC: printk cleanup
This implements the following idea: On Monday 30 January 2006 19:22, Eric W. Biederman wrote: > One piece missing from this conversation is the issue that we need errors > in a uniform format. That is why edac_mc has helper functions. > > However there will always be errors that don't fit any particular model. > Could we add a edac_printk(dev, ); That is similar to dev_printk but > prints out an EDAC header and the device on which the error was found? > Letting the rest of the string be user specified. > > For actual control that interface may be to blunt, but at least for people > looking in the logs it allows all of the errors to be detected and > harvested. Signed-off-by: David S. Peterson <dsp@llnl.gov> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/edac/amd76x_edac.c23
-rw-r--r--drivers/edac/e752x_edac.c90
-rw-r--r--drivers/edac/e7xxx_edac.c62
-rw-r--r--drivers/edac/edac_mc.c186
-rw-r--r--drivers/edac/edac_mc.h23
-rw-r--r--drivers/edac/i82860_edac.c32
-rw-r--r--drivers/edac/i82875p_edac.c51
-rw-r--r--drivers/edac/r82600_edac.c48
8 files changed, 275 insertions, 240 deletions
diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c
index 2fcc8120b53c..60535bb9275f 100644
--- a/drivers/edac/amd76x_edac.c
+++ b/drivers/edac/amd76x_edac.c
@@ -25,6 +25,14 @@
25#include "edac_mc.h" 25#include "edac_mc.h"
26 26
27 27
28#define amd76x_printk(level, fmt, arg...) \
29 edac_printk(level, "amd76x", fmt, ##arg)
30
31
32#define amd76x_mc_printk(mci, level, fmt, arg...) \
33 edac_mc_chipset_printk(mci, level, "amd76x", fmt, ##arg)
34
35
28#define AMD76X_NR_CSROWS 8 36#define AMD76X_NR_CSROWS 8
29#define AMD76X_NR_CHANS 1 37#define AMD76X_NR_CHANS 1
30#define AMD76X_NR_DIMMS 4 38#define AMD76X_NR_DIMMS 4
@@ -174,7 +182,7 @@ static int amd76x_process_error_info (struct mem_ctl_info *mci,
174static void amd76x_check(struct mem_ctl_info *mci) 182static void amd76x_check(struct mem_ctl_info *mci)
175{ 183{
176 struct amd76x_error_info info; 184 struct amd76x_error_info info;
177 debugf3("MC: " __FILE__ ": %s()\n", __func__); 185 debugf3("%s()\n", __func__);
178 amd76x_get_error_info(mci, &info); 186 amd76x_get_error_info(mci, &info);
179 amd76x_process_error_info(mci, &info, 1); 187 amd76x_process_error_info(mci, &info, 1);
180} 188}
@@ -204,7 +212,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
204 u32 ems; 212 u32 ems;
205 u32 ems_mode; 213 u32 ems_mode;
206 214
207 debugf0("MC: " __FILE__ ": %s()\n", __func__); 215 debugf0("%s()\n", __func__);
208 216
209 pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, &ems); 217 pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, &ems);
210 ems_mode = (ems >> 10) & 0x3; 218 ems_mode = (ems >> 10) & 0x3;
@@ -216,7 +224,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
216 goto fail; 224 goto fail;
217 } 225 }
218 226
219 debugf0("MC: " __FILE__ ": %s(): mci = %p\n", __func__, mci); 227 debugf0("%s(): mci = %p\n", __func__, mci);
220 228
221 mci->pdev = pci_dev_get(pdev); 229 mci->pdev = pci_dev_get(pdev);
222 mci->mtype_cap = MEM_FLAG_RDDR; 230 mci->mtype_cap = MEM_FLAG_RDDR;
@@ -267,13 +275,12 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
267 (u32) (0x3 << 8)); 275 (u32) (0x3 << 8));
268 276
269 if (edac_mc_add_mc(mci)) { 277 if (edac_mc_add_mc(mci)) {
270 debugf3("MC: " __FILE__ 278 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
271 ": %s(): failed edac_mc_add_mc()\n", __func__);
272 goto fail; 279 goto fail;
273 } 280 }
274 281
275 /* get this far and it's successful */ 282 /* get this far and it's successful */
276 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 283 debugf3("%s(): success\n", __func__);
277 return 0; 284 return 0;
278 285
279fail: 286fail:
@@ -289,7 +296,7 @@ fail:
289static int __devinit amd76x_init_one(struct pci_dev *pdev, 296static int __devinit amd76x_init_one(struct pci_dev *pdev,
290 const struct pci_device_id *ent) 297 const struct pci_device_id *ent)
291{ 298{
292 debugf0("MC: " __FILE__ ": %s()\n", __func__); 299 debugf0("%s()\n", __func__);
293 300
294 /* don't need to call pci_device_enable() */ 301 /* don't need to call pci_device_enable() */
295 return amd76x_probe1(pdev, ent->driver_data); 302 return amd76x_probe1(pdev, ent->driver_data);
@@ -309,7 +316,7 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev)
309{ 316{
310 struct mem_ctl_info *mci; 317 struct mem_ctl_info *mci;
311 318
312 debugf0(__FILE__ ": %s()\n", __func__); 319 debugf0("%s()\n", __func__);
313 320
314 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL) 321 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL)
315 return; 322 return;
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index c454ded2b060..25edba55b18c 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -30,6 +30,14 @@
30#include "edac_mc.h" 30#include "edac_mc.h"
31 31
32 32
33#define e752x_printk(level, fmt, arg...) \
34 edac_printk(level, "e752x", fmt, ##arg)
35
36
37#define e752x_mc_printk(mci, level, fmt, arg...) \
38 edac_mc_chipset_printk(mci, level, "e752x", fmt, ##arg)
39
40
33#ifndef PCI_DEVICE_ID_INTEL_7520_0 41#ifndef PCI_DEVICE_ID_INTEL_7520_0
34#define PCI_DEVICE_ID_INTEL_7520_0 0x3590 42#define PCI_DEVICE_ID_INTEL_7520_0 0x3590
35#endif /* PCI_DEVICE_ID_INTEL_7520_0 */ 43#endif /* PCI_DEVICE_ID_INTEL_7520_0 */
@@ -215,7 +223,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
215 u32 remap; 223 u32 remap;
216 struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info; 224 struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info;
217 225
218 debugf3("MC: " __FILE__ ": %s()\n", __func__); 226 debugf3("%s()\n", __func__);
219 227
220 if (page < pvt->tolm) 228 if (page < pvt->tolm)
221 return page; 229 return page;
@@ -224,7 +232,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
224 remap = (page - pvt->tolm) + pvt->remapbase; 232 remap = (page - pvt->tolm) + pvt->remapbase;
225 if (remap < pvt->remaplimit) 233 if (remap < pvt->remaplimit)
226 return remap; 234 return remap;
227 printk(KERN_ERR "Invalid page %lx - out of range\n", page); 235 e752x_printk(KERN_ERR, "Invalid page %lx - out of range\n", page);
228 return pvt->tolm - 1; 236 return pvt->tolm - 1;
229} 237}
230 238
@@ -237,7 +245,7 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one,
237 int i; 245 int i;
238 struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info; 246 struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info;
239 247
240 debugf3("MC: " __FILE__ ": %s()\n", __func__); 248 debugf3("%s()\n", __func__);
241 249
242 /* convert the addr to 4k page */ 250 /* convert the addr to 4k page */
243 page = sec1_add >> (PAGE_SHIFT - 4); 251 page = sec1_add >> (PAGE_SHIFT - 4);
@@ -246,24 +254,23 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one,
246 if (pvt->mc_symmetric) { 254 if (pvt->mc_symmetric) {
247 /* chip select are bits 14 & 13 */ 255 /* chip select are bits 14 & 13 */
248 row = ((page >> 1) & 3); 256 row = ((page >> 1) & 3);
249 printk(KERN_WARNING 257 e752x_printk(KERN_WARNING,
250 "Test row %d Table %d %d %d %d %d %d %d %d\n", 258 "Test row %d Table %d %d %d %d %d %d %d %d\n",
251 row, pvt->map[0], pvt->map[1], pvt->map[2], 259 row, pvt->map[0], pvt->map[1], pvt->map[2],
252 pvt->map[3], pvt->map[4], pvt->map[5], 260 pvt->map[3], pvt->map[4], pvt->map[5],
253 pvt->map[6], pvt->map[7]); 261 pvt->map[6], pvt->map[7]);
254 262
255 /* test for channel remapping */ 263 /* test for channel remapping */
256 for (i = 0; i < 8; i++) { 264 for (i = 0; i < 8; i++) {
257 if (pvt->map[i] == row) 265 if (pvt->map[i] == row)
258 break; 266 break;
259 } 267 }
260 printk(KERN_WARNING "Test computed row %d\n", i); 268 e752x_printk(KERN_WARNING, "Test computed row %d\n", i);
261 if (i < 8) 269 if (i < 8)
262 row = i; 270 row = i;
263 else 271 else
264 printk(KERN_WARNING 272 e752x_mc_printk(mci, KERN_WARNING,
265 "MC%d: row %d not found in remap table\n", 273 "row %d not found in remap table\n", row);
266 mci->mc_idx, row);
267 } else 274 } else
268 row = edac_mc_find_csrow_by_page(mci, page); 275 row = edac_mc_find_csrow_by_page(mci, page);
269 /* 0 = channel A, 1 = channel B */ 276 /* 0 = channel A, 1 = channel B */
@@ -293,7 +300,7 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, u32 ded_add,
293 int row; 300 int row;
294 struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info; 301 struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info;
295 302
296 debugf3("MC: " __FILE__ ": %s()\n", __func__); 303 debugf3("%s()\n", __func__);
297 304
298 if (error_one & 0x0202) { 305 if (error_one & 0x0202) {
299 error_2b = ded_add; 306 error_2b = ded_add;
@@ -336,7 +343,7 @@ static inline void process_ue_no_info_wr(struct mem_ctl_info *mci,
336 if (!handle_error) 343 if (!handle_error)
337 return; 344 return;
338 345
339 debugf3("MC: " __FILE__ ": %s()\n", __func__); 346 debugf3("%s()\n", __func__);
340 edac_mc_handle_ue_no_info(mci, "e752x UE log memory write"); 347 edac_mc_handle_ue_no_info(mci, "e752x UE log memory write");
341} 348}
342 349
@@ -352,9 +359,9 @@ static void do_process_ded_retry(struct mem_ctl_info *mci, u16 error,
352 row = pvt->mc_symmetric ? 359 row = pvt->mc_symmetric ?
353 ((page >> 1) & 3) : /* chip select are bits 14 & 13 */ 360 ((page >> 1) & 3) : /* chip select are bits 14 & 13 */
354 edac_mc_find_csrow_by_page(mci, page); 361 edac_mc_find_csrow_by_page(mci, page);
355 printk(KERN_WARNING 362 e752x_mc_printk(mci, KERN_WARNING,
356 "MC%d: CE page 0x%lx, row %d : Memory read retry\n", 363 "CE page 0x%lx, row %d : Memory read retry\n",
357 mci->mc_idx, (long unsigned int) page, row); 364 (long unsigned int) page, row);
358} 365}
359 366
360static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error, 367static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error,
@@ -372,8 +379,7 @@ static inline void process_threshold_ce(struct mem_ctl_info *mci, u16 error,
372 *error_found = 1; 379 *error_found = 1;
373 380
374 if (handle_error) 381 if (handle_error)
375 printk(KERN_WARNING "MC%d: Memory threshold CE\n", 382 e752x_mc_printk(mci, KERN_WARNING, "Memory threshold CE\n");
376 mci->mc_idx);
377} 383}
378 384
379static char *global_message[11] = { 385static char *global_message[11] = {
@@ -391,7 +397,7 @@ static void do_global_error(int fatal, u32 errors)
391 397
392 for (i = 0; i < 11; i++) { 398 for (i = 0; i < 11; i++) {
393 if (errors & (1 << i)) 399 if (errors & (1 << i))
394 printk(KERN_WARNING "%sError %s\n", 400 e752x_printk(KERN_WARNING, "%sError %s\n",
395 fatal_message[fatal], global_message[i]); 401 fatal_message[fatal], global_message[i]);
396 } 402 }
397} 403}
@@ -418,7 +424,7 @@ static void do_hub_error(int fatal, u8 errors)
418 424
419 for (i = 0; i < 7; i++) { 425 for (i = 0; i < 7; i++) {
420 if (errors & (1 << i)) 426 if (errors & (1 << i))
421 printk(KERN_WARNING "%sError %s\n", 427 e752x_printk(KERN_WARNING, "%sError %s\n",
422 fatal_message[fatal], hub_message[i]); 428 fatal_message[fatal], hub_message[i]);
423 } 429 }
424} 430}
@@ -445,7 +451,7 @@ static void do_membuf_error(u8 errors)
445 451
446 for (i = 0; i < 4; i++) { 452 for (i = 0; i < 4; i++) {
447 if (errors & (1 << i)) 453 if (errors & (1 << i))
448 printk(KERN_WARNING "Non-Fatal Error %s\n", 454 e752x_printk(KERN_WARNING, "Non-Fatal Error %s\n",
449 membuf_message[i]); 455 membuf_message[i]);
450 } 456 }
451} 457}
@@ -478,7 +484,7 @@ static void do_sysbus_error(int fatal, u32 errors)
478 484
479 for (i = 0; i < 10; i++) { 485 for (i = 0; i < 10; i++) {
480 if (errors & (1 << i)) 486 if (errors & (1 << i))
481 printk(KERN_WARNING "%sError System Bus %s\n", 487 e752x_printk(KERN_WARNING, "%sError System Bus %s\n",
482 fatal_message[fatal], global_message[i]); 488 fatal_message[fatal], global_message[i]);
483 } 489 }
484} 490}
@@ -727,7 +733,7 @@ static int e752x_process_error_info (struct mem_ctl_info *mci,
727static void e752x_check(struct mem_ctl_info *mci) 733static void e752x_check(struct mem_ctl_info *mci)
728{ 734{
729 struct e752x_error_info info; 735 struct e752x_error_info info;
730 debugf3("MC: " __FILE__ ": %s()\n", __func__); 736 debugf3("%s()\n", __func__);
731 e752x_get_error_info(mci, &info); 737 e752x_get_error_info(mci, &info);
732 e752x_process_error_info(mci, &info, 1); 738 e752x_process_error_info(mci, &info, 1);
733} 739}
@@ -752,7 +758,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
752 struct pci_dev *pres_dev; 758 struct pci_dev *pres_dev;
753 struct pci_dev *dev = NULL; 759 struct pci_dev *dev = NULL;
754 760
755 debugf0("MC: " __FILE__ ": %s(): mci\n", __func__); 761 debugf0("%s(): mci\n", __func__);
756 debugf0("Starting Probe1\n"); 762 debugf0("Starting Probe1\n");
757 763
758 /* enable device 0 function 1 */ 764 /* enable device 0 function 1 */
@@ -776,7 +782,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
776 goto fail; 782 goto fail;
777 } 783 }
778 784
779 debugf3("MC: " __FILE__ ": %s(): init mci\n", __func__); 785 debugf3("%s(): init mci\n", __func__);
780 786
781 mci->mtype_cap = MEM_FLAG_RDDR; 787 mci->mtype_cap = MEM_FLAG_RDDR;
782 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED | 788 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED |
@@ -786,7 +792,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
786 mci->mod_ver = "$Revision: 1.5.2.11 $"; 792 mci->mod_ver = "$Revision: 1.5.2.11 $";
787 mci->pdev = pdev; 793 mci->pdev = pdev;
788 794
789 debugf3("MC: " __FILE__ ": %s(): init pvt\n", __func__); 795 debugf3("%s(): init pvt\n", __func__);
790 pvt = (struct e752x_pvt *) mci->pvt_info; 796 pvt = (struct e752x_pvt *) mci->pvt_info;
791 pvt->dev_info = &e752x_devs[dev_idx]; 797 pvt->dev_info = &e752x_devs[dev_idx];
792 pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, 798 pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
@@ -796,14 +802,14 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
796 pvt->bridge_ck = pci_scan_single_device(pdev->bus, 802 pvt->bridge_ck = pci_scan_single_device(pdev->bus,
797 PCI_DEVFN(0, 1)); 803 PCI_DEVFN(0, 1));
798 if (pvt->bridge_ck == NULL) { 804 if (pvt->bridge_ck == NULL) {
799 printk(KERN_ERR "MC: error reporting device not found:" 805 e752x_printk(KERN_ERR, "error reporting device not found:"
800 "vendor %x device 0x%x (broken BIOS?)\n", 806 "vendor %x device 0x%x (broken BIOS?)\n",
801 PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); 807 PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev);
802 goto fail; 808 goto fail;
803 } 809 }
804 pvt->mc_symmetric = ((ddrcsr & 0x10) != 0); 810 pvt->mc_symmetric = ((ddrcsr & 0x10) != 0);
805 811
806 debugf3("MC: " __FILE__ ": %s(): more mci init\n", __func__); 812 debugf3("%s(): more mci init\n", __func__);
807 mci->ctl_name = pvt->dev_info->ctl_name; 813 mci->ctl_name = pvt->dev_info->ctl_name;
808 mci->edac_check = e752x_check; 814 mci->edac_check = e752x_check;
809 mci->ctl_page_to_phys = ctl_page_to_phys; 815 mci->ctl_page_to_phys = ctl_page_to_phys;
@@ -828,8 +834,8 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
828 pci_read_config_byte(mci->pdev, E752X_DRB + index, &value); 834 pci_read_config_byte(mci->pdev, E752X_DRB + index, &value);
829 /* convert a 128 or 64 MiB DRB to a page size. */ 835 /* convert a 128 or 64 MiB DRB to a page size. */
830 cumul_size = value << (25 + drc_drbg - PAGE_SHIFT); 836 cumul_size = value << (25 + drc_drbg - PAGE_SHIFT);
831 debugf3("MC: " __FILE__ ": %s(): (%d) cumul_size 0x%x\n", 837 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
832 __func__, index, cumul_size); 838 cumul_size);
833 if (cumul_size == last_cumul_size) 839 if (cumul_size == last_cumul_size)
834 continue; /* not populated */ 840 continue; /* not populated */
835 841
@@ -897,8 +903,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
897 903
898 mci->edac_cap |= EDAC_FLAG_NONE; 904 mci->edac_cap |= EDAC_FLAG_NONE;
899 905
900 debugf3("MC: " __FILE__ ": %s(): tolm, remapbase, remaplimit\n", 906 debugf3("%s(): tolm, remapbase, remaplimit\n", __func__);
901 __func__);
902 /* load the top of low memory, remap base, and remap limit vars */ 907 /* load the top of low memory, remap base, and remap limit vars */
903 pci_read_config_word(mci->pdev, E752X_TOLM, &pci_data); 908 pci_read_config_word(mci->pdev, E752X_TOLM, &pci_data);
904 pvt->tolm = ((u32) pci_data) << 4; 909 pvt->tolm = ((u32) pci_data) << 4;
@@ -906,13 +911,12 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
906 pvt->remapbase = ((u32) pci_data) << 14; 911 pvt->remapbase = ((u32) pci_data) << 14;
907 pci_read_config_word(mci->pdev, E752X_REMAPLIMIT, &pci_data); 912 pci_read_config_word(mci->pdev, E752X_REMAPLIMIT, &pci_data);
908 pvt->remaplimit = ((u32) pci_data) << 14; 913 pvt->remaplimit = ((u32) pci_data) << 14;
909 printk("tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, 914 e752x_printk(KERN_INFO,
910 pvt->remapbase, pvt->remaplimit); 915 "tolm = %x, remapbase = %x, remaplimit = %x\n",
916 pvt->tolm, pvt->remapbase, pvt->remaplimit);
911 917
912 if (edac_mc_add_mc(mci)) { 918 if (edac_mc_add_mc(mci)) {
913 debugf3("MC: " __FILE__ 919 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
914 ": %s(): failed edac_mc_add_mc()\n",
915 __func__);
916 goto fail; 920 goto fail;
917 } 921 }
918 922
@@ -975,7 +979,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
975 pci_write_config_word(dev, E752X_DRAM_NERR, stat16); 979 pci_write_config_word(dev, E752X_DRAM_NERR, stat16);
976 980
977 /* get this far and it's successful */ 981 /* get this far and it's successful */
978 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 982 debugf3("%s(): success\n", __func__);
979 return 0; 983 return 0;
980 984
981fail: 985fail:
@@ -995,7 +999,7 @@ fail:
995static int __devinit e752x_init_one(struct pci_dev *pdev, 999static int __devinit e752x_init_one(struct pci_dev *pdev,
996 const struct pci_device_id *ent) 1000 const struct pci_device_id *ent)
997{ 1001{
998 debugf0("MC: " __FILE__ ": %s()\n", __func__); 1002 debugf0("%s()\n", __func__);
999 1003
1000 /* wake up and enable device */ 1004 /* wake up and enable device */
1001 if(pci_enable_device(pdev) < 0) 1005 if(pci_enable_device(pdev) < 0)
@@ -1009,7 +1013,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev)
1009 struct mem_ctl_info *mci; 1013 struct mem_ctl_info *mci;
1010 struct e752x_pvt *pvt; 1014 struct e752x_pvt *pvt;
1011 1015
1012 debugf0(__FILE__ ": %s()\n", __func__); 1016 debugf0("%s()\n", __func__);
1013 1017
1014 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL) 1018 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL)
1015 return; 1019 return;
@@ -1050,7 +1054,7 @@ static int __init e752x_init(void)
1050{ 1054{
1051 int pci_rc; 1055 int pci_rc;
1052 1056
1053 debugf3("MC: " __FILE__ ": %s()\n", __func__); 1057 debugf3("%s()\n", __func__);
1054 pci_rc = pci_register_driver(&e752x_driver); 1058 pci_rc = pci_register_driver(&e752x_driver);
1055 return (pci_rc < 0) ? pci_rc : 0; 1059 return (pci_rc < 0) ? pci_rc : 0;
1056} 1060}
@@ -1058,7 +1062,7 @@ static int __init e752x_init(void)
1058 1062
1059static void __exit e752x_exit(void) 1063static void __exit e752x_exit(void)
1060{ 1064{
1061 debugf3("MC: " __FILE__ ": %s()\n", __func__); 1065 debugf3("%s()\n", __func__);
1062 pci_unregister_driver(&e752x_driver); 1066 pci_unregister_driver(&e752x_driver);
1063} 1067}
1064 1068
diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c
index d5e320dfc66f..e7537413cad2 100644
--- a/drivers/edac/e7xxx_edac.c
+++ b/drivers/edac/e7xxx_edac.c
@@ -32,6 +32,14 @@
32#include "edac_mc.h" 32#include "edac_mc.h"
33 33
34 34
35#define e7xxx_printk(level, fmt, arg...) \
36 edac_printk(level, "e7xxx", fmt, ##arg)
37
38
39#define e7xxx_mc_printk(mci, level, fmt, arg...) \
40 edac_mc_chipset_printk(mci, level, "e7xxx", fmt, ##arg)
41
42
35#ifndef PCI_DEVICE_ID_INTEL_7205_0 43#ifndef PCI_DEVICE_ID_INTEL_7205_0
36#define PCI_DEVICE_ID_INTEL_7205_0 0x255d 44#define PCI_DEVICE_ID_INTEL_7205_0 0x255d
37#endif /* PCI_DEVICE_ID_INTEL_7205_0 */ 45#endif /* PCI_DEVICE_ID_INTEL_7205_0 */
@@ -161,7 +169,7 @@ static const struct e7xxx_dev_info e7xxx_devs[] = {
161/* FIXME - is this valid for both SECDED and S4ECD4ED? */ 169/* FIXME - is this valid for both SECDED and S4ECD4ED? */
162static inline int e7xxx_find_channel(u16 syndrome) 170static inline int e7xxx_find_channel(u16 syndrome)
163{ 171{
164 debugf3("MC: " __FILE__ ": %s()\n", __func__); 172 debugf3("%s()\n", __func__);
165 173
166 if ((syndrome & 0xff00) == 0) 174 if ((syndrome & 0xff00) == 0)
167 return 0; 175 return 0;
@@ -179,7 +187,7 @@ ctl_page_to_phys(struct mem_ctl_info *mci, unsigned long page)
179 u32 remap; 187 u32 remap;
180 struct e7xxx_pvt *pvt = (struct e7xxx_pvt *) mci->pvt_info; 188 struct e7xxx_pvt *pvt = (struct e7xxx_pvt *) mci->pvt_info;
181 189
182 debugf3("MC: " __FILE__ ": %s()\n", __func__); 190 debugf3("%s()\n", __func__);
183 191
184 if ((page < pvt->tolm) || 192 if ((page < pvt->tolm) ||
185 ((page >= 0x100000) && (page < pvt->remapbase))) 193 ((page >= 0x100000) && (page < pvt->remapbase)))
@@ -187,7 +195,7 @@ ctl_page_to_phys(struct mem_ctl_info *mci, unsigned long page)
187 remap = (page - pvt->tolm) + pvt->remapbase; 195 remap = (page - pvt->tolm) + pvt->remapbase;
188 if (remap < pvt->remaplimit) 196 if (remap < pvt->remaplimit)
189 return remap; 197 return remap;
190 printk(KERN_ERR "Invalid page %lx - out of range\n", page); 198 e7xxx_printk(KERN_ERR, "Invalid page %lx - out of range\n", page);
191 return pvt->tolm - 1; 199 return pvt->tolm - 1;
192} 200}
193 201
@@ -199,7 +207,7 @@ static void process_ce(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
199 int row; 207 int row;
200 int channel; 208 int channel;
201 209
202 debugf3("MC: " __FILE__ ": %s()\n", __func__); 210 debugf3("%s()\n", __func__);
203 211
204 /* read the error address */ 212 /* read the error address */
205 error_1b = info->dram_celog_add; 213 error_1b = info->dram_celog_add;
@@ -218,7 +226,7 @@ static void process_ce(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
218 226
219static void process_ce_no_info(struct mem_ctl_info *mci) 227static void process_ce_no_info(struct mem_ctl_info *mci)
220{ 228{
221 debugf3("MC: " __FILE__ ": %s()\n", __func__); 229 debugf3("%s()\n", __func__);
222 edac_mc_handle_ce_no_info(mci, "e7xxx CE log register overflow"); 230 edac_mc_handle_ce_no_info(mci, "e7xxx CE log register overflow");
223} 231}
224 232
@@ -228,7 +236,7 @@ static void process_ue(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
228 u32 error_2b, block_page; 236 u32 error_2b, block_page;
229 int row; 237 int row;
230 238
231 debugf3("MC: " __FILE__ ": %s()\n", __func__); 239 debugf3("%s()\n", __func__);
232 240
233 /* read the error address */ 241 /* read the error address */
234 error_2b = info->dram_uelog_add; 242 error_2b = info->dram_uelog_add;
@@ -241,7 +249,7 @@ static void process_ue(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
241 249
242static void process_ue_no_info(struct mem_ctl_info *mci) 250static void process_ue_no_info(struct mem_ctl_info *mci)
243{ 251{
244 debugf3("MC: " __FILE__ ": %s()\n", __func__); 252 debugf3("%s()\n", __func__);
245 edac_mc_handle_ue_no_info(mci, "e7xxx UE log register overflow"); 253 edac_mc_handle_ue_no_info(mci, "e7xxx UE log register overflow");
246} 254}
247 255
@@ -330,7 +338,7 @@ static void e7xxx_check(struct mem_ctl_info *mci)
330{ 338{
331 struct e7xxx_error_info info; 339 struct e7xxx_error_info info;
332 340
333 debugf3("MC: " __FILE__ ": %s()\n", __func__); 341 debugf3("%s()\n", __func__);
334 e7xxx_get_error_info(mci, &info); 342 e7xxx_get_error_info(mci, &info);
335 e7xxx_process_error_info(mci, &info, 1); 343 e7xxx_process_error_info(mci, &info, 1);
336} 344}
@@ -351,7 +359,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
351 unsigned long last_cumul_size; 359 unsigned long last_cumul_size;
352 360
353 361
354 debugf0("MC: " __FILE__ ": %s(): mci\n", __func__); 362 debugf0("%s(): mci\n", __func__);
355 363
356 /* need to find out the number of channels */ 364 /* need to find out the number of channels */
357 pci_read_config_dword(pdev, E7XXX_DRC, &drc); 365 pci_read_config_dword(pdev, E7XXX_DRC, &drc);
@@ -369,7 +377,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
369 goto fail; 377 goto fail;
370 } 378 }
371 379
372 debugf3("MC: " __FILE__ ": %s(): init mci\n", __func__); 380 debugf3("%s(): init mci\n", __func__);
373 381
374 mci->mtype_cap = MEM_FLAG_RDDR; 382 mci->mtype_cap = MEM_FLAG_RDDR;
375 mci->edac_ctl_cap = 383 mci->edac_ctl_cap =
@@ -379,21 +387,21 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
379 mci->mod_ver = "$Revision: 1.5.2.9 $"; 387 mci->mod_ver = "$Revision: 1.5.2.9 $";
380 mci->pdev = pdev; 388 mci->pdev = pdev;
381 389
382 debugf3("MC: " __FILE__ ": %s(): init pvt\n", __func__); 390 debugf3("%s(): init pvt\n", __func__);
383 pvt = (struct e7xxx_pvt *) mci->pvt_info; 391 pvt = (struct e7xxx_pvt *) mci->pvt_info;
384 pvt->dev_info = &e7xxx_devs[dev_idx]; 392 pvt->dev_info = &e7xxx_devs[dev_idx];
385 pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, 393 pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
386 pvt->dev_info->err_dev, 394 pvt->dev_info->err_dev,
387 pvt->bridge_ck); 395 pvt->bridge_ck);
388 if (!pvt->bridge_ck) { 396 if (!pvt->bridge_ck) {
389 printk(KERN_ERR 397 e7xxx_printk(KERN_ERR, "error reporting device not found:"
390 "MC: error reporting device not found:" 398 "vendor %x device 0x%x (broken BIOS?)\n",
391 "vendor %x device 0x%x (broken BIOS?)\n", 399 PCI_VENDOR_ID_INTEL,
392 PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev); 400 e7xxx_devs[dev_idx].err_dev);
393 goto fail; 401 goto fail;
394 } 402 }
395 403
396 debugf3("MC: " __FILE__ ": %s(): more mci init\n", __func__); 404 debugf3("%s(): more mci init\n", __func__);
397 mci->ctl_name = pvt->dev_info->ctl_name; 405 mci->ctl_name = pvt->dev_info->ctl_name;
398 406
399 mci->edac_check = e7xxx_check; 407 mci->edac_check = e7xxx_check;
@@ -418,8 +426,8 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
418 pci_read_config_byte(mci->pdev, E7XXX_DRB + index, &value); 426 pci_read_config_byte(mci->pdev, E7XXX_DRB + index, &value);
419 /* convert a 64 or 32 MiB DRB to a page size. */ 427 /* convert a 64 or 32 MiB DRB to a page size. */
420 cumul_size = value << (25 + drc_drbg - PAGE_SHIFT); 428 cumul_size = value << (25 + drc_drbg - PAGE_SHIFT);
421 debugf3("MC: " __FILE__ ": %s(): (%d) cumul_size 0x%x\n", 429 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
422 __func__, index, cumul_size); 430 cumul_size);
423 if (cumul_size == last_cumul_size) 431 if (cumul_size == last_cumul_size)
424 continue; /* not populated */ 432 continue; /* not populated */
425 433
@@ -449,8 +457,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
449 457
450 mci->edac_cap |= EDAC_FLAG_NONE; 458 mci->edac_cap |= EDAC_FLAG_NONE;
451 459
452 debugf3("MC: " __FILE__ ": %s(): tolm, remapbase, remaplimit\n", 460 debugf3("%s(): tolm, remapbase, remaplimit\n", __func__);
453 __func__);
454 /* load the top of low memory, remap base, and remap limit vars */ 461 /* load the top of low memory, remap base, and remap limit vars */
455 pci_read_config_word(mci->pdev, E7XXX_TOLM, &pci_data); 462 pci_read_config_word(mci->pdev, E7XXX_TOLM, &pci_data);
456 pvt->tolm = ((u32) pci_data) << 4; 463 pvt->tolm = ((u32) pci_data) << 4;
@@ -458,22 +465,21 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
458 pvt->remapbase = ((u32) pci_data) << 14; 465 pvt->remapbase = ((u32) pci_data) << 14;
459 pci_read_config_word(mci->pdev, E7XXX_REMAPLIMIT, &pci_data); 466 pci_read_config_word(mci->pdev, E7XXX_REMAPLIMIT, &pci_data);
460 pvt->remaplimit = ((u32) pci_data) << 14; 467 pvt->remaplimit = ((u32) pci_data) << 14;
461 printk("tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, 468 e7xxx_printk(KERN_INFO,
462 pvt->remapbase, pvt->remaplimit); 469 "tolm = %x, remapbase = %x, remaplimit = %x\n",
470 pvt->tolm, pvt->remapbase, pvt->remaplimit);
463 471
464 /* clear any pending errors, or initial state bits */ 472 /* clear any pending errors, or initial state bits */
465 pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_FERR, 0x03, 0x03); 473 pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_FERR, 0x03, 0x03);
466 pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_NERR, 0x03, 0x03); 474 pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_NERR, 0x03, 0x03);
467 475
468 if (edac_mc_add_mc(mci) != 0) { 476 if (edac_mc_add_mc(mci) != 0) {
469 debugf3("MC: " __FILE__ 477 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
470 ": %s(): failed edac_mc_add_mc()\n",
471 __func__);
472 goto fail; 478 goto fail;
473 } 479 }
474 480
475 /* get this far and it's successful */ 481 /* get this far and it's successful */
476 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 482 debugf3("%s(): success\n", __func__);
477 return 0; 483 return 0;
478 484
479fail: 485fail:
@@ -490,7 +496,7 @@ fail:
490static int __devinit 496static int __devinit
491e7xxx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 497e7xxx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
492{ 498{
493 debugf0("MC: " __FILE__ ": %s()\n", __func__); 499 debugf0("%s()\n", __func__);
494 500
495 /* wake up and enable device */ 501 /* wake up and enable device */
496 return pci_enable_device(pdev) ? 502 return pci_enable_device(pdev) ?
@@ -503,7 +509,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
503 struct mem_ctl_info *mci; 509 struct mem_ctl_info *mci;
504 struct e7xxx_pvt *pvt; 510 struct e7xxx_pvt *pvt;
505 511
506 debugf0(__FILE__ ": %s()\n", __func__); 512 debugf0("%s()\n", __func__);
507 513
508 if (((mci = edac_mc_find_mci_by_pdev(pdev)) != 0) && 514 if (((mci = edac_mc_find_mci_by_pdev(pdev)) != 0) &&
509 edac_mc_del_mc(mci)) { 515 edac_mc_del_mc(mci)) {
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 8a7a3ab745aa..499ac90ad67e 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -37,7 +37,7 @@
37 37
38#include "edac_mc.h" 38#include "edac_mc.h"
39 39
40#define EDAC_MC_VERSION "edac_mc Ver: 2.0.0 " __DATE__ 40#define EDAC_MC_VERSION "Ver: 2.0.0 " __DATE__
41 41
42/* For now, disable the EDAC sysfs code. The sysfs interface that EDAC 42/* For now, disable the EDAC sysfs code. The sysfs interface that EDAC
43 * presents to user space needs more thought, and is likely to change 43 * presents to user space needs more thought, and is likely to change
@@ -243,7 +243,7 @@ static struct memctrl_dev_attribute *memctrl_attr[] = {
243/* Main MC kobject release() function */ 243/* Main MC kobject release() function */
244static void edac_memctrl_master_release(struct kobject *kobj) 244static void edac_memctrl_master_release(struct kobject *kobj)
245{ 245{
246 debugf1("EDAC MC: " __FILE__ ": %s()\n", __func__); 246 debugf1("%s()\n", __func__);
247} 247}
248 248
249static struct kobj_type ktype_memctrl = { 249static struct kobj_type ktype_memctrl = {
@@ -271,7 +271,7 @@ static int edac_sysfs_memctrl_setup(void)
271{ 271{
272 int err=0; 272 int err=0;
273 273
274 debugf1("MC: " __FILE__ ": %s()\n", __func__); 274 debugf1("%s()\n", __func__);
275 275
276 /* create the /sys/devices/system/edac directory */ 276 /* create the /sys/devices/system/edac directory */
277 err = sysdev_class_register(&edac_class); 277 err = sysdev_class_register(&edac_class);
@@ -295,7 +295,7 @@ static int edac_sysfs_memctrl_setup(void)
295 } 295 }
296 } 296 }
297 } else { 297 } else {
298 debugf1(KERN_WARNING "__FILE__ %s() error=%d\n", __func__,err); 298 debugf1("%s() error=%d\n", __func__, err);
299 } 299 }
300 300
301 return err; 301 return err;
@@ -567,7 +567,7 @@ static struct edac_pci_dev_attribute *edac_pci_attr[] = {
567/* No memory to release */ 567/* No memory to release */
568static void edac_pci_release(struct kobject *kobj) 568static void edac_pci_release(struct kobject *kobj)
569{ 569{
570 debugf1("EDAC PCI: " __FILE__ ": %s()\n", __func__); 570 debugf1("%s()\n", __func__);
571} 571}
572 572
573static struct kobj_type ktype_edac_pci = { 573static struct kobj_type ktype_edac_pci = {
@@ -591,7 +591,7 @@ static int edac_sysfs_pci_setup(void)
591{ 591{
592 int err; 592 int err;
593 593
594 debugf1("MC: " __FILE__ ": %s()\n", __func__); 594 debugf1("%s()\n", __func__);
595 595
596 memset(&edac_pci_kobj, 0, sizeof(edac_pci_kobj)); 596 memset(&edac_pci_kobj, 0, sizeof(edac_pci_kobj));
597 597
@@ -616,7 +616,7 @@ static int edac_sysfs_pci_setup(void)
616static void edac_sysfs_pci_teardown(void) 616static void edac_sysfs_pci_teardown(void)
617{ 617{
618#ifndef DISABLE_EDAC_SYSFS 618#ifndef DISABLE_EDAC_SYSFS
619 debugf0("MC: " __FILE__ ": %s()\n", __func__); 619 debugf0("%s()\n", __func__);
620 620
621 kobject_unregister(&edac_pci_kobj); 621 kobject_unregister(&edac_pci_kobj);
622 kobject_put(&edac_pci_kobj); 622 kobject_put(&edac_pci_kobj);
@@ -808,7 +808,7 @@ static struct csrowdev_attribute *csrow_attr[] = {
808/* No memory to release */ 808/* No memory to release */
809static void edac_csrow_instance_release(struct kobject *kobj) 809static void edac_csrow_instance_release(struct kobject *kobj)
810{ 810{
811 debugf1("EDAC MC: " __FILE__ ": %s()\n", __func__); 811 debugf1("%s()\n", __func__);
812} 812}
813 813
814static struct kobj_type ktype_csrow = { 814static struct kobj_type ktype_csrow = {
@@ -823,7 +823,7 @@ static int edac_create_csrow_object(struct kobject *edac_mci_kobj,
823{ 823{
824 int err = 0; 824 int err = 0;
825 825
826 debugf0("MC: " __FILE__ ": %s()\n", __func__); 826 debugf0("%s()\n", __func__);
827 827
828 memset(&csrow->kobj, 0, sizeof(csrow->kobj)); 828 memset(&csrow->kobj, 0, sizeof(csrow->kobj));
829 829
@@ -1066,8 +1066,7 @@ static void edac_mci_instance_release(struct kobject *kobj)
1066 struct mem_ctl_info *mci; 1066 struct mem_ctl_info *mci;
1067 mci = container_of(kobj,struct mem_ctl_info,edac_mci_kobj); 1067 mci = container_of(kobj,struct mem_ctl_info,edac_mci_kobj);
1068 1068
1069 debugf0("MC: " __FILE__ ": %s() idx=%d calling kfree\n", 1069 debugf0("%s() idx=%d calling kfree\n", __func__, mci->mc_idx);
1070 __func__, mci->mc_idx);
1071 1070
1072 kfree(mci); 1071 kfree(mci);
1073} 1072}
@@ -1102,7 +1101,7 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
1102 struct csrow_info *csrow; 1101 struct csrow_info *csrow;
1103 struct kobject *edac_mci_kobj=&mci->edac_mci_kobj; 1102 struct kobject *edac_mci_kobj=&mci->edac_mci_kobj;
1104 1103
1105 debugf0("MC: " __FILE__ ": %s() idx=%d\n", __func__, mci->mc_idx); 1104 debugf0("%s() idx=%d\n", __func__, mci->mc_idx);
1106 1105
1107 memset(edac_mci_kobj, 0, sizeof(*edac_mci_kobj)); 1106 memset(edac_mci_kobj, 0, sizeof(*edac_mci_kobj));
1108 kobject_init(edac_mci_kobj); 1107 kobject_init(edac_mci_kobj);
@@ -1174,7 +1173,7 @@ static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
1174#ifndef DISABLE_EDAC_SYSFS 1173#ifndef DISABLE_EDAC_SYSFS
1175 int i; 1174 int i;
1176 1175
1177 debugf0("MC: " __FILE__ ": %s()\n", __func__); 1176 debugf0("%s()\n", __func__);
1178 1177
1179 /* remove all csrow kobjects */ 1178 /* remove all csrow kobjects */
1180 for (i = 0; i < mci->nr_csrows; i++) { 1179 for (i = 0; i < mci->nr_csrows; i++) {
@@ -1396,7 +1395,7 @@ struct mem_ctl_info *edac_mc_find_mci_by_pdev(struct pci_dev *pdev)
1396 struct mem_ctl_info *mci; 1395 struct mem_ctl_info *mci;
1397 struct list_head *item; 1396 struct list_head *item;
1398 1397
1399 debugf3("MC: " __FILE__ ": %s()\n", __func__); 1398 debugf3("%s()\n", __func__);
1400 1399
1401 list_for_each(item, &mc_devices) { 1400 list_for_each(item, &mc_devices) {
1402 mci = list_entry(item, struct mem_ctl_info, link); 1401 mci = list_entry(item, struct mem_ctl_info, link);
@@ -1419,10 +1418,11 @@ static int add_mc_to_global_list (struct mem_ctl_info *mci)
1419 insert_before = &mc_devices; 1418 insert_before = &mc_devices;
1420 } else { 1419 } else {
1421 if (edac_mc_find_mci_by_pdev(mci->pdev)) { 1420 if (edac_mc_find_mci_by_pdev(mci->pdev)) {
1422 printk(KERN_WARNING 1421 edac_printk(KERN_WARNING, EDAC_MC,
1423 "EDAC MC: %s (%s) %s %s already assigned %d\n", 1422 "%s (%s) %s %s already assigned %d\n",
1424 mci->pdev->dev.bus_id, pci_name(mci->pdev), 1423 mci->pdev->dev.bus_id,
1425 mci->mod_name, mci->ctl_name, mci->mc_idx); 1424 pci_name(mci->pdev), mci->mod_name,
1425 mci->ctl_name, mci->mc_idx);
1426 return 1; 1426 return 1;
1427 } 1427 }
1428 1428
@@ -1468,7 +1468,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
1468{ 1468{
1469 int rc = 1; 1469 int rc = 1;
1470 1470
1471 debugf0("MC: " __FILE__ ": %s()\n", __func__); 1471 debugf0("%s()\n", __func__);
1472#ifdef CONFIG_EDAC_DEBUG 1472#ifdef CONFIG_EDAC_DEBUG
1473 if (edac_debug_level >= 3) 1473 if (edac_debug_level >= 3)
1474 edac_mc_dump_mci(mci); 1474 edac_mc_dump_mci(mci);
@@ -1493,19 +1493,15 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
1493 mci->start_time = jiffies; 1493 mci->start_time = jiffies;
1494 1494
1495 if (edac_create_sysfs_mci_device(mci)) { 1495 if (edac_create_sysfs_mci_device(mci)) {
1496 printk(KERN_WARNING 1496 edac_mc_printk(mci, KERN_WARNING,
1497 "EDAC MC%d: failed to create sysfs device\n", 1497 "failed to create sysfs device\n");
1498 mci->mc_idx);
1499 /* FIXME - should there be an error code and unwind? */ 1498 /* FIXME - should there be an error code and unwind? */
1500 goto finish; 1499 goto finish;
1501 } 1500 }
1502 1501
1503 /* Report action taken */ 1502 /* Report action taken */
1504 printk(KERN_INFO 1503 edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: PCI %s\n",
1505 "EDAC MC%d: Giving out device to %s %s: PCI %s\n", 1504 mci->mod_name, mci->ctl_name, pci_name(mci->pdev));
1506 mci->mc_idx, mci->mod_name, mci->ctl_name,
1507 pci_name(mci->pdev));
1508
1509 1505
1510 rc = 0; 1506 rc = 0;
1511 1507
@@ -1547,13 +1543,12 @@ int edac_mc_del_mc(struct mem_ctl_info *mci)
1547{ 1543{
1548 int rc = 1; 1544 int rc = 1;
1549 1545
1550 debugf0("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); 1546 debugf0("MC%d: %s()\n", mci->mc_idx, __func__);
1551 down(&mem_ctls_mutex); 1547 down(&mem_ctls_mutex);
1552 del_mc_from_global_list(mci); 1548 del_mc_from_global_list(mci);
1553 printk(KERN_INFO 1549 edac_printk(KERN_INFO, EDAC_MC,
1554 "EDAC MC%d: Removed device %d for %s %s: PCI %s\n", 1550 "Removed device %d for %s %s: PCI %s\n", mci->mc_idx,
1555 mci->mc_idx, mci->mc_idx, mci->mod_name, mci->ctl_name, 1551 mci->mod_name, mci->ctl_name, pci_name(mci->pdev));
1556 pci_name(mci->pdev));
1557 rc = 0; 1552 rc = 0;
1558 up(&mem_ctls_mutex); 1553 up(&mem_ctls_mutex);
1559 1554
@@ -1570,7 +1565,7 @@ void edac_mc_scrub_block(unsigned long page, unsigned long offset,
1570 void *virt_addr; 1565 void *virt_addr;
1571 unsigned long flags = 0; 1566 unsigned long flags = 0;
1572 1567
1573 debugf3("MC: " __FILE__ ": %s()\n", __func__); 1568 debugf3("%s()\n", __func__);
1574 1569
1575 /* ECC error page was not in our memory. Ignore it. */ 1570 /* ECC error page was not in our memory. Ignore it. */
1576 if(!pfn_valid(page)) 1571 if(!pfn_valid(page))
@@ -1604,8 +1599,7 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,
1604 struct csrow_info *csrows = mci->csrows; 1599 struct csrow_info *csrows = mci->csrows;
1605 int row, i; 1600 int row, i;
1606 1601
1607 debugf1("MC%d: " __FILE__ ": %s(): 0x%lx\n", mci->mc_idx, __func__, 1602 debugf1("MC%d: %s(): 0x%lx\n", mci->mc_idx, __func__, page);
1608 page);
1609 row = -1; 1603 row = -1;
1610 1604
1611 for (i = 0; i < mci->nr_csrows; i++) { 1605 for (i = 0; i < mci->nr_csrows; i++) {
@@ -1614,11 +1608,10 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,
1614 if (csrow->nr_pages == 0) 1608 if (csrow->nr_pages == 0)
1615 continue; 1609 continue;
1616 1610
1617 debugf3("MC%d: " __FILE__ 1611 debugf3("MC%d: %s(): first(0x%lx) page(0x%lx) last(0x%lx) "
1618 ": %s(): first(0x%lx) page(0x%lx)" 1612 "mask(0x%lx)\n", mci->mc_idx, __func__,
1619 " last(0x%lx) mask(0x%lx)\n", mci->mc_idx, 1613 csrow->first_page, page, csrow->last_page,
1620 __func__, csrow->first_page, page, 1614 csrow->page_mask);
1621 csrow->last_page, csrow->page_mask);
1622 1615
1623 if ((page >= csrow->first_page) && 1616 if ((page >= csrow->first_page) &&
1624 (page <= csrow->last_page) && 1617 (page <= csrow->last_page) &&
@@ -1630,9 +1623,9 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,
1630 } 1623 }
1631 1624
1632 if (row == -1) 1625 if (row == -1)
1633 printk(KERN_ERR 1626 edac_mc_printk(mci, KERN_ERR,
1634 "EDAC MC%d: could not look up page error address %lx\n", 1627 "could not look up page error address %lx\n",
1635 mci->mc_idx, (unsigned long) page); 1628 (unsigned long) page);
1636 1629
1637 return row; 1630 return row;
1638} 1631}
@@ -1650,36 +1643,35 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci,
1650{ 1643{
1651 unsigned long remapped_page; 1644 unsigned long remapped_page;
1652 1645
1653 debugf3("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); 1646 debugf3("MC%d: %s()\n", mci->mc_idx, __func__);
1654 1647
1655 /* FIXME - maybe make panic on INTERNAL ERROR an option */ 1648 /* FIXME - maybe make panic on INTERNAL ERROR an option */
1656 if (row >= mci->nr_csrows || row < 0) { 1649 if (row >= mci->nr_csrows || row < 0) {
1657 /* something is wrong */ 1650 /* something is wrong */
1658 printk(KERN_ERR 1651 edac_mc_printk(mci, KERN_ERR,
1659 "EDAC MC%d: INTERNAL ERROR: row out of range (%d >= %d)\n", 1652 "INTERNAL ERROR: row out of range "
1660 mci->mc_idx, row, mci->nr_csrows); 1653 "(%d >= %d)\n", row, mci->nr_csrows);
1661 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); 1654 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
1662 return; 1655 return;
1663 } 1656 }
1664 if (channel >= mci->csrows[row].nr_channels || channel < 0) { 1657 if (channel >= mci->csrows[row].nr_channels || channel < 0) {
1665 /* something is wrong */ 1658 /* something is wrong */
1666 printk(KERN_ERR 1659 edac_mc_printk(mci, KERN_ERR,
1667 "EDAC MC%d: INTERNAL ERROR: channel out of range " 1660 "INTERNAL ERROR: channel out of range "
1668 "(%d >= %d)\n", 1661 "(%d >= %d)\n", channel,
1669 mci->mc_idx, channel, mci->csrows[row].nr_channels); 1662 mci->csrows[row].nr_channels);
1670 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); 1663 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
1671 return; 1664 return;
1672 } 1665 }
1673 1666
1674 if (log_ce) 1667 if (log_ce)
1675 /* FIXME - put in DIMM location */ 1668 /* FIXME - put in DIMM location */
1676 printk(KERN_WARNING 1669 edac_mc_printk(mci, KERN_WARNING,
1677 "EDAC MC%d: CE page 0x%lx, offset 0x%lx," 1670 "CE page 0x%lx, offset 0x%lx, grain %d, syndrome "
1678 " grain %d, syndrome 0x%lx, row %d, channel %d," 1671 "0x%lx, row %d, channel %d, label \"%s\": %s\n",
1679 " label \"%s\": %s\n", mci->mc_idx, 1672 page_frame_number, offset_in_page,
1680 page_frame_number, offset_in_page, 1673 mci->csrows[row].grain, syndrome, row, channel,
1681 mci->csrows[row].grain, syndrome, row, channel, 1674 mci->csrows[row].channels[channel].label, msg);
1682 mci->csrows[row].channels[channel].label, msg);
1683 1675
1684 mci->ce_count++; 1676 mci->ce_count++;
1685 mci->csrows[row].ce_count++; 1677 mci->csrows[row].ce_count++;
@@ -1711,9 +1703,8 @@ void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci,
1711 const char *msg) 1703 const char *msg)
1712{ 1704{
1713 if (log_ce) 1705 if (log_ce)
1714 printk(KERN_WARNING 1706 edac_mc_printk(mci, KERN_WARNING,
1715 "EDAC MC%d: CE - no information available: %s\n", 1707 "CE - no information available: %s\n", msg);
1716 mci->mc_idx, msg);
1717 mci->ce_noinfo_count++; 1708 mci->ce_noinfo_count++;
1718 mci->ce_count++; 1709 mci->ce_count++;
1719} 1710}
@@ -1732,14 +1723,14 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
1732 int chan; 1723 int chan;
1733 int chars; 1724 int chars;
1734 1725
1735 debugf3("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); 1726 debugf3("MC%d: %s()\n", mci->mc_idx, __func__);
1736 1727
1737 /* FIXME - maybe make panic on INTERNAL ERROR an option */ 1728 /* FIXME - maybe make panic on INTERNAL ERROR an option */
1738 if (row >= mci->nr_csrows || row < 0) { 1729 if (row >= mci->nr_csrows || row < 0) {
1739 /* something is wrong */ 1730 /* something is wrong */
1740 printk(KERN_ERR 1731 edac_mc_printk(mci, KERN_ERR,
1741 "EDAC MC%d: INTERNAL ERROR: row out of range (%d >= %d)\n", 1732 "INTERNAL ERROR: row out of range "
1742 mci->mc_idx, row, mci->nr_csrows); 1733 "(%d >= %d)\n", row, mci->nr_csrows);
1743 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); 1734 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR");
1744 return; 1735 return;
1745 } 1736 }
@@ -1757,11 +1748,11 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
1757 } 1748 }
1758 1749
1759 if (log_ue) 1750 if (log_ue)
1760 printk(KERN_EMERG 1751 edac_mc_printk(mci, KERN_EMERG,
1761 "EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, row %d," 1752 "UE page 0x%lx, offset 0x%lx, grain %d, row %d, "
1762 " labels \"%s\": %s\n", mci->mc_idx, 1753 "labels \"%s\": %s\n", page_frame_number,
1763 page_frame_number, offset_in_page, 1754 offset_in_page, mci->csrows[row].grain, row, labels,
1764 mci->csrows[row].grain, row, labels, msg); 1755 msg);
1765 1756
1766 if (panic_on_ue) 1757 if (panic_on_ue)
1767 panic 1758 panic
@@ -1784,9 +1775,8 @@ void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci,
1784 panic("EDAC MC%d: Uncorrected Error", mci->mc_idx); 1775 panic("EDAC MC%d: Uncorrected Error", mci->mc_idx);
1785 1776
1786 if (log_ue) 1777 if (log_ue)
1787 printk(KERN_WARNING 1778 edac_mc_printk(mci, KERN_WARNING,
1788 "EDAC MC%d: UE - no information available: %s\n", 1779 "UE - no information available: %s\n", msg);
1789 mci->mc_idx, msg);
1790 mci->ue_noinfo_count++; 1780 mci->ue_noinfo_count++;
1791 mci->ue_count++; 1781 mci->ue_count++;
1792} 1782}
@@ -1856,25 +1846,22 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
1856 /* check the status reg for errors */ 1846 /* check the status reg for errors */
1857 if (status) { 1847 if (status) {
1858 if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) 1848 if (status & (PCI_STATUS_SIG_SYSTEM_ERROR))
1859 printk(KERN_CRIT 1849 edac_printk(KERN_CRIT, EDAC_PCI,
1860 "EDAC PCI- "
1861 "Signaled System Error on %s\n", 1850 "Signaled System Error on %s\n",
1862 pci_name (dev)); 1851 pci_name(dev));
1863 1852
1864 if (status & (PCI_STATUS_PARITY)) { 1853 if (status & (PCI_STATUS_PARITY)) {
1865 printk(KERN_CRIT 1854 edac_printk(KERN_CRIT, EDAC_PCI,
1866 "EDAC PCI- "
1867 "Master Data Parity Error on %s\n", 1855 "Master Data Parity Error on %s\n",
1868 pci_name (dev)); 1856 pci_name(dev));
1869 1857
1870 atomic_inc(&pci_parity_count); 1858 atomic_inc(&pci_parity_count);
1871 } 1859 }
1872 1860
1873 if (status & (PCI_STATUS_DETECTED_PARITY)) { 1861 if (status & (PCI_STATUS_DETECTED_PARITY)) {
1874 printk(KERN_CRIT 1862 edac_printk(KERN_CRIT, EDAC_PCI,
1875 "EDAC PCI- "
1876 "Detected Parity Error on %s\n", 1863 "Detected Parity Error on %s\n",
1877 pci_name (dev)); 1864 pci_name(dev));
1878 1865
1879 atomic_inc(&pci_parity_count); 1866 atomic_inc(&pci_parity_count);
1880 } 1867 }
@@ -1895,25 +1882,22 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
1895 /* check the secondary status reg for errors */ 1882 /* check the secondary status reg for errors */
1896 if (status) { 1883 if (status) {
1897 if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) 1884 if (status & (PCI_STATUS_SIG_SYSTEM_ERROR))
1898 printk(KERN_CRIT 1885 edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
1899 "EDAC PCI-Bridge- "
1900 "Signaled System Error on %s\n", 1886 "Signaled System Error on %s\n",
1901 pci_name (dev)); 1887 pci_name(dev));
1902 1888
1903 if (status & (PCI_STATUS_PARITY)) { 1889 if (status & (PCI_STATUS_PARITY)) {
1904 printk(KERN_CRIT 1890 edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
1905 "EDAC PCI-Bridge- " 1891 "Master Data Parity Error on "
1906 "Master Data Parity Error on %s\n", 1892 "%s\n", pci_name(dev));
1907 pci_name (dev));
1908 1893
1909 atomic_inc(&pci_parity_count); 1894 atomic_inc(&pci_parity_count);
1910 } 1895 }
1911 1896
1912 if (status & (PCI_STATUS_DETECTED_PARITY)) { 1897 if (status & (PCI_STATUS_DETECTED_PARITY)) {
1913 printk(KERN_CRIT 1898 edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
1914 "EDAC PCI-Bridge- "
1915 "Detected Parity Error on %s\n", 1899 "Detected Parity Error on %s\n",
1916 pci_name (dev)); 1900 pci_name(dev));
1917 1901
1918 atomic_inc(&pci_parity_count); 1902 atomic_inc(&pci_parity_count);
1919 } 1903 }
@@ -1992,7 +1976,7 @@ static void do_pci_parity_check(void)
1992 unsigned long flags; 1976 unsigned long flags;
1993 int before_count; 1977 int before_count;
1994 1978
1995 debugf3("MC: " __FILE__ ": %s()\n", __func__); 1979 debugf3("%s()\n", __func__);
1996 1980
1997 if (!check_pci_parity) 1981 if (!check_pci_parity)
1998 return; 1982 return;
@@ -2050,7 +2034,7 @@ static inline void check_mc_devices (void)
2050 struct list_head *item; 2034 struct list_head *item;
2051 struct mem_ctl_info *mci; 2035 struct mem_ctl_info *mci;
2052 2036
2053 debugf3("MC: " __FILE__ ": %s()\n", __func__); 2037 debugf3("%s()\n", __func__);
2054 2038
2055 /* during poll, have interrupts off */ 2039 /* during poll, have interrupts off */
2056 local_irq_save(flags); 2040 local_irq_save(flags);
@@ -2076,10 +2060,8 @@ static inline void check_mc_devices (void)
2076 */ 2060 */
2077static void do_edac_check(void) 2061static void do_edac_check(void)
2078{ 2062{
2079 debugf3("MC: " __FILE__ ": %s()\n", __func__); 2063 debugf3("%s()\n", __func__);
2080
2081 check_mc_devices(); 2064 check_mc_devices();
2082
2083 do_pci_parity_check(); 2065 do_pci_parity_check();
2084} 2066}
2085 2067
@@ -2102,7 +2084,7 @@ static int edac_kernel_thread(void *arg)
2102 */ 2084 */
2103static int __init edac_mc_init(void) 2085static int __init edac_mc_init(void)
2104{ 2086{
2105 printk(KERN_INFO "MC: " __FILE__ " version " EDAC_MC_VERSION "\n"); 2087 edac_printk(KERN_INFO, EDAC_MC, EDAC_MC_VERSION "\n");
2106 2088
2107 /* 2089 /*
2108 * Harvest and clear any boot/initialization PCI parity errors 2090 * Harvest and clear any boot/initialization PCI parity errors
@@ -2118,14 +2100,16 @@ static int __init edac_mc_init(void)
2118 2100
2119 /* Create the MC sysfs entires */ 2101 /* Create the MC sysfs entires */
2120 if (edac_sysfs_memctrl_setup()) { 2102 if (edac_sysfs_memctrl_setup()) {
2121 printk(KERN_ERR "EDAC MC: Error initializing sysfs code\n"); 2103 edac_printk(KERN_ERR, EDAC_MC,
2104 "Error initializing sysfs code\n");
2122 return -ENODEV; 2105 return -ENODEV;
2123 } 2106 }
2124 2107
2125 /* Create the PCI parity sysfs entries */ 2108 /* Create the PCI parity sysfs entries */
2126 if (edac_sysfs_pci_setup()) { 2109 if (edac_sysfs_pci_setup()) {
2127 edac_sysfs_memctrl_teardown(); 2110 edac_sysfs_memctrl_teardown();
2128 printk(KERN_ERR "EDAC PCI: Error initializing sysfs code\n"); 2111 edac_printk(KERN_ERR, EDAC_MC,
2112 "EDAC PCI: Error initializing sysfs code\n");
2129 return -ENODEV; 2113 return -ENODEV;
2130 } 2114 }
2131 2115
@@ -2148,7 +2132,7 @@ static int __init edac_mc_init(void)
2148 */ 2132 */
2149static void __exit edac_mc_exit(void) 2133static void __exit edac_mc_exit(void)
2150{ 2134{
2151 debugf0("MC: " __FILE__ ": %s()\n", __func__); 2135 debugf0("%s()\n", __func__);
2152 2136
2153 kthread_stop(edac_thread); 2137 kthread_stop(edac_thread);
2154 2138
diff --git a/drivers/edac/edac_mc.h b/drivers/edac/edac_mc.h
index 75ecf484a43a..4bd8375a8d7e 100644
--- a/drivers/edac/edac_mc.h
+++ b/drivers/edac/edac_mc.h
@@ -43,10 +43,29 @@
43#define PAGES_TO_MiB( pages ) ( ( pages ) << ( PAGE_SHIFT - 20 ) ) 43#define PAGES_TO_MiB( pages ) ( ( pages ) << ( PAGE_SHIFT - 20 ) )
44#endif 44#endif
45 45
46#define edac_printk(level, prefix, fmt, arg...) \
47 printk(level "EDAC " prefix ": " fmt, ##arg)
48
49#define edac_mc_printk(mci, level, fmt, arg...) \
50 printk(level "EDAC MC%d: " fmt, mci->mc_idx, ##arg)
51
52#define edac_mc_chipset_printk(mci, level, prefix, fmt, arg...) \
53 printk(level "EDAC " prefix " MC%d: " fmt, mci->mc_idx, ##arg)
54
55/* prefixes for edac_printk() and edac_mc_printk() */
56#define EDAC_MC "MC"
57#define EDAC_PCI "PCI"
58#define EDAC_DEBUG "DEBUG"
59
46#ifdef CONFIG_EDAC_DEBUG 60#ifdef CONFIG_EDAC_DEBUG
47extern int edac_debug_level; 61extern int edac_debug_level;
48#define edac_debug_printk(level, fmt, args...) \ 62
49do { if (level <= edac_debug_level) printk(KERN_DEBUG fmt, ##args); } while(0) 63#define edac_debug_printk(level, fmt, arg...) \
64 do { \
65 if (level <= edac_debug_level) \
66 edac_printk(KERN_DEBUG, EDAC_DEBUG, fmt, ##arg); \
67 } while(0)
68
50#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ ) 69#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ )
51#define debugf1( ... ) edac_debug_printk(1, __VA_ARGS__ ) 70#define debugf1( ... ) edac_debug_printk(1, __VA_ARGS__ )
52#define debugf2( ... ) edac_debug_printk(2, __VA_ARGS__ ) 71#define debugf2( ... ) edac_debug_printk(2, __VA_ARGS__ )
diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c
index 52596e75f9c2..fa9ab84fa5c9 100644
--- a/drivers/edac/i82860_edac.c
+++ b/drivers/edac/i82860_edac.c
@@ -19,6 +19,14 @@
19#include "edac_mc.h" 19#include "edac_mc.h"
20 20
21 21
22#define i82860_printk(level, fmt, arg...) \
23 edac_printk(level, "i82860", fmt, ##arg)
24
25
26#define i82860_mc_printk(mci, level, fmt, arg...) \
27 edac_mc_chipset_printk(mci, level, "i82860", fmt, ##arg)
28
29
22#ifndef PCI_DEVICE_ID_INTEL_82860_0 30#ifndef PCI_DEVICE_ID_INTEL_82860_0
23#define PCI_DEVICE_ID_INTEL_82860_0 0x2531 31#define PCI_DEVICE_ID_INTEL_82860_0 0x2531
24#endif /* PCI_DEVICE_ID_INTEL_82860_0 */ 32#endif /* PCI_DEVICE_ID_INTEL_82860_0 */
@@ -117,7 +125,7 @@ static void i82860_check(struct mem_ctl_info *mci)
117{ 125{
118 struct i82860_error_info info; 126 struct i82860_error_info info;
119 127
120 debugf1("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); 128 debugf1("MC%d: %s()\n", mci->mc_idx, __func__);
121 i82860_get_error_info(mci, &info); 129 i82860_get_error_info(mci, &info);
122 i82860_process_error_info(mci, &info, 1); 130 i82860_process_error_info(mci, &info, 1);
123} 131}
@@ -143,7 +151,7 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
143 if (!mci) 151 if (!mci)
144 return -ENOMEM; 152 return -ENOMEM;
145 153
146 debugf3("MC: " __FILE__ ": %s(): init mci\n", __func__); 154 debugf3("%s(): init mci\n", __func__);
147 155
148 mci->pdev = pdev; 156 mci->pdev = pdev;
149 mci->mtype_cap = MEM_FLAG_DDR; 157 mci->mtype_cap = MEM_FLAG_DDR;
@@ -179,8 +187,8 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
179 187
180 cumul_size = (value & I82860_GBA_MASK) << 188 cumul_size = (value & I82860_GBA_MASK) <<
181 (I82860_GBA_SHIFT - PAGE_SHIFT); 189 (I82860_GBA_SHIFT - PAGE_SHIFT);
182 debugf3("MC: " __FILE__ ": %s(): (%d) cumul_size 0x%x\n", 190 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
183 __func__, index, cumul_size); 191 cumul_size);
184 if (cumul_size == last_cumul_size) 192 if (cumul_size == last_cumul_size)
185 continue; /* not populated */ 193 continue; /* not populated */
186 194
@@ -198,13 +206,11 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
198 pci_write_bits16(mci->pdev, I82860_ERRSTS, 0x0003, 0x0003); 206 pci_write_bits16(mci->pdev, I82860_ERRSTS, 0x0003, 0x0003);
199 207
200 if (edac_mc_add_mc(mci)) { 208 if (edac_mc_add_mc(mci)) {
201 debugf3("MC: " __FILE__ 209 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
202 ": %s(): failed edac_mc_add_mc()\n",
203 __func__);
204 edac_mc_free(mci); 210 edac_mc_free(mci);
205 } else { 211 } else {
206 /* get this far and it's successful */ 212 /* get this far and it's successful */
207 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 213 debugf3("%s(): success\n", __func__);
208 rc = 0; 214 rc = 0;
209 } 215 }
210 return rc; 216 return rc;
@@ -216,9 +222,9 @@ static int __devinit i82860_init_one(struct pci_dev *pdev,
216{ 222{
217 int rc; 223 int rc;
218 224
219 debugf0("MC: " __FILE__ ": %s()\n", __func__); 225 debugf0("%s()\n", __func__);
220 226
221 printk(KERN_INFO "i82860 init one\n"); 227 i82860_printk(KERN_INFO, "i82860 init one\n");
222 if(pci_enable_device(pdev) < 0) 228 if(pci_enable_device(pdev) < 0)
223 return -EIO; 229 return -EIO;
224 rc = i82860_probe1(pdev, ent->driver_data); 230 rc = i82860_probe1(pdev, ent->driver_data);
@@ -231,7 +237,7 @@ static void __devexit i82860_remove_one(struct pci_dev *pdev)
231{ 237{
232 struct mem_ctl_info *mci; 238 struct mem_ctl_info *mci;
233 239
234 debugf0(__FILE__ ": %s()\n", __func__); 240 debugf0("%s()\n", __func__);
235 241
236 mci = edac_mc_find_mci_by_pdev(pdev); 242 mci = edac_mc_find_mci_by_pdev(pdev);
237 if ((mci != NULL) && (edac_mc_del_mc(mci) == 0)) 243 if ((mci != NULL) && (edac_mc_del_mc(mci) == 0))
@@ -257,7 +263,7 @@ static int __init i82860_init(void)
257{ 263{
258 int pci_rc; 264 int pci_rc;
259 265
260 debugf3("MC: " __FILE__ ": %s()\n", __func__); 266 debugf3("%s()\n", __func__);
261 if ((pci_rc = pci_register_driver(&i82860_driver)) < 0) 267 if ((pci_rc = pci_register_driver(&i82860_driver)) < 0)
262 return pci_rc; 268 return pci_rc;
263 269
@@ -281,7 +287,7 @@ static int __init i82860_init(void)
281 287
282static void __exit i82860_exit(void) 288static void __exit i82860_exit(void)
283{ 289{
284 debugf3("MC: " __FILE__ ": %s()\n", __func__); 290 debugf3("%s()\n", __func__);
285 291
286 pci_unregister_driver(&i82860_driver); 292 pci_unregister_driver(&i82860_driver);
287 if (!i82860_registered) { 293 if (!i82860_registered) {
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c
index 1991f94af753..0e22c66ee36c 100644
--- a/drivers/edac/i82875p_edac.c
+++ b/drivers/edac/i82875p_edac.c
@@ -26,6 +26,14 @@
26#include "edac_mc.h" 26#include "edac_mc.h"
27 27
28 28
29#define i82875p_printk(level, fmt, arg...) \
30 edac_printk(level, "i82875p", fmt, ##arg)
31
32
33#define i82875p_mc_printk(mci, level, fmt, arg...) \
34 edac_mc_chipset_printk(mci, level, "i82875p", fmt, ##arg)
35
36
29#ifndef PCI_DEVICE_ID_INTEL_82875_0 37#ifndef PCI_DEVICE_ID_INTEL_82875_0
30#define PCI_DEVICE_ID_INTEL_82875_0 0x2578 38#define PCI_DEVICE_ID_INTEL_82875_0 0x2578
31#endif /* PCI_DEVICE_ID_INTEL_82875_0 */ 39#endif /* PCI_DEVICE_ID_INTEL_82875_0 */
@@ -254,7 +262,7 @@ static void i82875p_check(struct mem_ctl_info *mci)
254{ 262{
255 struct i82875p_error_info info; 263 struct i82875p_error_info info;
256 264
257 debugf1("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); 265 debugf1("MC%d: %s()\n", mci->mc_idx, __func__);
258 i82875p_get_error_info(mci, &info); 266 i82875p_get_error_info(mci, &info);
259 i82875p_process_error_info(mci, &info, 1); 267 i82875p_process_error_info(mci, &info, 1);
260} 268}
@@ -279,7 +287,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
279 u32 nr_chans; 287 u32 nr_chans;
280 u32 drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ 288 u32 drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */
281 289
282 debugf0("MC: " __FILE__ ": %s()\n", __func__); 290 debugf0("%s()\n", __func__);
283 291
284 ovrfl_pdev = pci_find_device(PCI_VEND_DEV(INTEL, 82875_6), NULL); 292 ovrfl_pdev = pci_find_device(PCI_VEND_DEV(INTEL, 82875_6), NULL);
285 293
@@ -298,16 +306,16 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
298 } 306 }
299#ifdef CONFIG_PROC_FS 307#ifdef CONFIG_PROC_FS
300 if (!ovrfl_pdev->procent && pci_proc_attach_device(ovrfl_pdev)) { 308 if (!ovrfl_pdev->procent && pci_proc_attach_device(ovrfl_pdev)) {
301 printk(KERN_ERR "MC: " __FILE__ 309 i82875p_printk(KERN_ERR,
302 ": %s(): Failed to attach overflow device\n", 310 "%s(): Failed to attach overflow device\n",
303 __func__); 311 __func__);
304 goto fail; 312 goto fail;
305 } 313 }
306#endif /* CONFIG_PROC_FS */ 314#endif /* CONFIG_PROC_FS */
307 if (pci_enable_device(ovrfl_pdev)) { 315 if (pci_enable_device(ovrfl_pdev)) {
308 printk(KERN_ERR "MC: " __FILE__ 316 i82875p_printk(KERN_ERR,
309 ": %s(): Failed to enable overflow device\n", 317 "%s(): Failed to enable overflow device\n",
310 __func__); 318 __func__);
311 goto fail; 319 goto fail;
312 } 320 }
313 321
@@ -321,8 +329,8 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
321 pci_resource_len(ovrfl_pdev, 0)); 329 pci_resource_len(ovrfl_pdev, 0));
322 330
323 if (!ovrfl_window) { 331 if (!ovrfl_window) {
324 printk(KERN_ERR "MC: " __FILE__ 332 i82875p_printk(KERN_ERR, "%s(): Failed to ioremap bar6\n",
325 ": %s(): Failed to ioremap bar6\n", __func__); 333 __func__);
326 goto fail; 334 goto fail;
327 } 335 }
328 336
@@ -340,7 +348,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
340 goto fail; 348 goto fail;
341 } 349 }
342 350
343 debugf3("MC: " __FILE__ ": %s(): init mci\n", __func__); 351 debugf3("%s(): init mci\n", __func__);
344 352
345 mci->pdev = pdev; 353 mci->pdev = pdev;
346 mci->mtype_cap = MEM_FLAG_DDR; 354 mci->mtype_cap = MEM_FLAG_DDR;
@@ -355,7 +363,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
355 mci->edac_check = i82875p_check; 363 mci->edac_check = i82875p_check;
356 mci->ctl_page_to_phys = NULL; 364 mci->ctl_page_to_phys = NULL;
357 365
358 debugf3("MC: " __FILE__ ": %s(): init pvt\n", __func__); 366 debugf3("%s(): init pvt\n", __func__);
359 367
360 pvt = (struct i82875p_pvt *) mci->pvt_info; 368 pvt = (struct i82875p_pvt *) mci->pvt_info;
361 pvt->ovrfl_pdev = ovrfl_pdev; 369 pvt->ovrfl_pdev = ovrfl_pdev;
@@ -374,8 +382,8 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
374 382
375 value = readb(ovrfl_window + I82875P_DRB + index); 383 value = readb(ovrfl_window + I82875P_DRB + index);
376 cumul_size = value << (I82875P_DRB_SHIFT - PAGE_SHIFT); 384 cumul_size = value << (I82875P_DRB_SHIFT - PAGE_SHIFT);
377 debugf3("MC: " __FILE__ ": %s(): (%d) cumul_size 0x%x\n", 385 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
378 __func__, index, cumul_size); 386 cumul_size);
379 if (cumul_size == last_cumul_size) 387 if (cumul_size == last_cumul_size)
380 continue; /* not populated */ 388 continue; /* not populated */
381 389
@@ -393,13 +401,12 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
393 pci_write_bits16(mci->pdev, I82875P_ERRSTS, 0x0081, 0x0081); 401 pci_write_bits16(mci->pdev, I82875P_ERRSTS, 0x0081, 0x0081);
394 402
395 if (edac_mc_add_mc(mci)) { 403 if (edac_mc_add_mc(mci)) {
396 debugf3("MC: " __FILE__ 404 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
397 ": %s(): failed edac_mc_add_mc()\n", __func__);
398 goto fail; 405 goto fail;
399 } 406 }
400 407
401 /* get this far and it's successful */ 408 /* get this far and it's successful */
402 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 409 debugf3("%s(): success\n", __func__);
403 return 0; 410 return 0;
404 411
405 fail: 412 fail:
@@ -425,9 +432,9 @@ static int __devinit i82875p_init_one(struct pci_dev *pdev,
425{ 432{
426 int rc; 433 int rc;
427 434
428 debugf0("MC: " __FILE__ ": %s()\n", __func__); 435 debugf0("%s()\n", __func__);
429 436
430 printk(KERN_INFO "i82875p init one\n"); 437 i82875p_printk(KERN_INFO, "i82875p init one\n");
431 if(pci_enable_device(pdev) < 0) 438 if(pci_enable_device(pdev) < 0)
432 return -EIO; 439 return -EIO;
433 rc = i82875p_probe1(pdev, ent->driver_data); 440 rc = i82875p_probe1(pdev, ent->driver_data);
@@ -442,7 +449,7 @@ static void __devexit i82875p_remove_one(struct pci_dev *pdev)
442 struct mem_ctl_info *mci; 449 struct mem_ctl_info *mci;
443 struct i82875p_pvt *pvt = NULL; 450 struct i82875p_pvt *pvt = NULL;
444 451
445 debugf0(__FILE__ ": %s()\n", __func__); 452 debugf0("%s()\n", __func__);
446 453
447 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL) 454 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL)
448 return; 455 return;
@@ -487,7 +494,7 @@ static int __init i82875p_init(void)
487{ 494{
488 int pci_rc; 495 int pci_rc;
489 496
490 debugf3("MC: " __FILE__ ": %s()\n", __func__); 497 debugf3("%s()\n", __func__);
491 pci_rc = pci_register_driver(&i82875p_driver); 498 pci_rc = pci_register_driver(&i82875p_driver);
492 if (pci_rc < 0) 499 if (pci_rc < 0)
493 return pci_rc; 500 return pci_rc;
@@ -513,7 +520,7 @@ static int __init i82875p_init(void)
513 520
514static void __exit i82875p_exit(void) 521static void __exit i82875p_exit(void)
515{ 522{
516 debugf3("MC: " __FILE__ ": %s()\n", __func__); 523 debugf3("%s()\n", __func__);
517 524
518 pci_unregister_driver(&i82875p_driver); 525 pci_unregister_driver(&i82875p_driver);
519 if (!i82875p_registered) { 526 if (!i82875p_registered) {
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index e90892831b90..27d16dc2f11d 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -26,6 +26,12 @@
26 26
27#include "edac_mc.h" 27#include "edac_mc.h"
28 28
29#define r82600_printk(level, fmt, arg...) \
30 edac_printk(level, "r82600", fmt, ##arg)
31
32#define r82600_mc_printk(mci, level, fmt, arg...) \
33 edac_mc_chipset_printk(mci, level, "r82600", fmt, ##arg)
34
29/* Radisys say "The 82600 integrates a main memory SDRAM controller that 35/* Radisys say "The 82600 integrates a main memory SDRAM controller that
30 * supports up to four banks of memory. The four banks can support a mix of 36 * supports up to four banks of memory. The four banks can support a mix of
31 * sizes of 64 bit wide (72 bits with ECC) Synchronous DRAM (SDRAM) DIMMs, 37 * sizes of 64 bit wide (72 bits with ECC) Synchronous DRAM (SDRAM) DIMMs,
@@ -196,7 +202,7 @@ static void r82600_check(struct mem_ctl_info *mci)
196{ 202{
197 struct r82600_error_info info; 203 struct r82600_error_info info;
198 204
199 debugf1("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); 205 debugf1("MC%d: %s()\n", mci->mc_idx, __func__);
200 r82600_get_error_info(mci, &info); 206 r82600_get_error_info(mci, &info);
201 r82600_process_error_info(mci, &info, 1); 207 r82600_process_error_info(mci, &info, 1);
202} 208}
@@ -215,7 +221,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
215 u32 row_high_limit_last = 0; 221 u32 row_high_limit_last = 0;
216 u32 eap_init_bits; 222 u32 eap_init_bits;
217 223
218 debugf0("MC: " __FILE__ ": %s()\n", __func__); 224 debugf0("%s()\n", __func__);
219 225
220 226
221 pci_read_config_byte(pdev, R82600_DRAMC, &dramcr); 227 pci_read_config_byte(pdev, R82600_DRAMC, &dramcr);
@@ -226,11 +232,10 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
226 scrub_disabled = eapr & BIT(31); 232 scrub_disabled = eapr & BIT(31);
227 sdram_refresh_rate = dramcr & (BIT(0) | BIT(1)); 233 sdram_refresh_rate = dramcr & (BIT(0) | BIT(1));
228 234
229 debugf2("MC: " __FILE__ ": %s(): sdram refresh rate = %#0x\n", 235 debugf2("%s(): sdram refresh rate = %#0x\n", __func__,
230 __func__, sdram_refresh_rate); 236 sdram_refresh_rate);
231 237
232 debugf2("MC: " __FILE__ ": %s(): DRAMC register = %#0x\n", __func__, 238 debugf2("%s(): DRAMC register = %#0x\n", __func__, dramcr);
233 dramcr);
234 239
235 mci = edac_mc_alloc(0, R82600_NR_CSROWS, R82600_NR_CHANS); 240 mci = edac_mc_alloc(0, R82600_NR_CSROWS, R82600_NR_CHANS);
236 241
@@ -239,7 +244,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
239 goto fail; 244 goto fail;
240 } 245 }
241 246
242 debugf0("MC: " __FILE__ ": %s(): mci = %p\n", __func__, mci); 247 debugf0("%s(): mci = %p\n", __func__, mci);
243 248
244 mci->pdev = pdev; 249 mci->pdev = pdev;
245 mci->mtype_cap = MEM_FLAG_RDDR | MEM_FLAG_DDR; 250 mci->mtype_cap = MEM_FLAG_RDDR | MEM_FLAG_DDR;
@@ -255,9 +260,8 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
255 mci->edac_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; 260 mci->edac_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
256 if (ecc_on) { 261 if (ecc_on) {
257 if (scrub_disabled) 262 if (scrub_disabled)
258 debugf3("MC: " __FILE__ ": %s(): mci = %p - " 263 debugf3("%s(): mci = %p - Scrubbing disabled! EAP: "
259 "Scrubbing disabled! EAP: %#0x\n", __func__, 264 "%#0x\n", __func__, mci, eapr);
260 mci, eapr);
261 } else 265 } else
262 mci->edac_cap = EDAC_FLAG_NONE; 266 mci->edac_cap = EDAC_FLAG_NONE;
263 267
@@ -276,16 +280,15 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
276 /* find the DRAM Chip Select Base address and mask */ 280 /* find the DRAM Chip Select Base address and mask */
277 pci_read_config_byte(mci->pdev, R82600_DRBA + index, &drbar); 281 pci_read_config_byte(mci->pdev, R82600_DRBA + index, &drbar);
278 282
279 debugf1("MC%d: " __FILE__ ": %s() Row=%d DRBA = %#0x\n", 283 debugf1("MC%d: %s() Row=%d DRBA = %#0x\n", mci->mc_idx,
280 mci->mc_idx, __func__, index, drbar); 284 __func__, index, drbar);
281 285
282 row_high_limit = ((u32) drbar << 24); 286 row_high_limit = ((u32) drbar << 24);
283/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */ 287/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */
284 288
285 debugf1("MC%d: " __FILE__ ": %s() Row=%d, " 289 debugf1("MC%d: %s() Row=%d, Boundry Address=%#0x, Last = "
286 "Boundry Address=%#0x, Last = %#0x \n", 290 "%#0x \n", mci->mc_idx, __func__, index,
287 mci->mc_idx, __func__, index, row_high_limit, 291 row_high_limit, row_high_limit_last);
288 row_high_limit_last);
289 292
290 /* Empty row [p.57] */ 293 /* Empty row [p.57] */
291 if (row_high_limit == row_high_limit_last) 294 if (row_high_limit == row_high_limit_last)
@@ -312,8 +315,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
312 /* FIXME should we? */ 315 /* FIXME should we? */
313 316
314 if (edac_mc_add_mc(mci)) { 317 if (edac_mc_add_mc(mci)) {
315 debugf3("MC: " __FILE__ 318 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
316 ": %s(): failed edac_mc_add_mc()\n", __func__);
317 goto fail; 319 goto fail;
318 } 320 }
319 321
@@ -325,14 +327,14 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
325 eap_init_bits = BIT(0) & BIT(1); 327 eap_init_bits = BIT(0) & BIT(1);
326 if (disable_hardware_scrub) { 328 if (disable_hardware_scrub) {
327 eap_init_bits |= BIT(31); 329 eap_init_bits |= BIT(31);
328 debugf3("MC: " __FILE__ ": %s(): Disabling Hardware Scrub " 330 debugf3("%s(): Disabling Hardware Scrub (scrub on error)\n",
329 "(scrub on error)\n", __func__); 331 __func__);
330 } 332 }
331 333
332 pci_write_bits32(mci->pdev, R82600_EAP, eap_init_bits, 334 pci_write_bits32(mci->pdev, R82600_EAP, eap_init_bits,
333 eap_init_bits); 335 eap_init_bits);
334 336
335 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 337 debugf3("%s(): success\n", __func__);
336 return 0; 338 return 0;
337 339
338fail: 340fail:
@@ -346,7 +348,7 @@ fail:
346static int __devinit r82600_init_one(struct pci_dev *pdev, 348static int __devinit r82600_init_one(struct pci_dev *pdev,
347 const struct pci_device_id *ent) 349 const struct pci_device_id *ent)
348{ 350{
349 debugf0("MC: " __FILE__ ": %s()\n", __func__); 351 debugf0("%s()\n", __func__);
350 352
351 /* don't need to call pci_device_enable() */ 353 /* don't need to call pci_device_enable() */
352 return r82600_probe1(pdev, ent->driver_data); 354 return r82600_probe1(pdev, ent->driver_data);
@@ -357,7 +359,7 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev)
357{ 359{
358 struct mem_ctl_info *mci; 360 struct mem_ctl_info *mci;
359 361
360 debugf0(__FILE__ ": %s()\n", __func__); 362 debugf0("%s()\n", __func__);
361 363
362 if (((mci = edac_mc_find_mci_by_pdev(pdev)) != NULL) && 364 if (((mci = edac_mc_find_mci_by_pdev(pdev)) != NULL) &&
363 !edac_mc_del_mc(mci)) 365 !edac_mc_del_mc(mci))