aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorDouglas Thompson <dougthompson@xmission.com>2007-07-19 04:50:13 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:55 -0400
commit052dfb45ccb5ea354a426b52556bcfee75b9d2f5 (patch)
tree3f85586625b25f7eaf0471c99fc296bdd4ada4eb /drivers/edac
parent6bc7840411b8c7fe11e1879d882c88119d1c033e (diff)
drivers/edac: cleanup spaces-gotos after Lindent messup
This patch fixes some remnant spaces inserted by the use of Lindent. Seems Lindent adds some spaces when it shoulded. These have been fixed. In addition, goto targets have issues, these have been fixed in this patch. 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/amd76x_edac.c26
-rw-r--r--drivers/edac/e752x_edac.c181
-rw-r--r--drivers/edac/e7xxx_edac.c54
-rw-r--r--drivers/edac/edac_device.c110
-rw-r--r--drivers/edac/edac_device_sysfs.c112
-rw-r--r--drivers/edac/edac_mc.c144
-rw-r--r--drivers/edac/edac_mc_sysfs.c84
-rw-r--r--drivers/edac/edac_module.c10
-rw-r--r--drivers/edac/edac_pci.c34
-rw-r--r--drivers/edac/edac_pci_sysfs.c46
-rw-r--r--drivers/edac/i3000_edac.c21
-rw-r--r--drivers/edac/i5000_edac.c160
-rw-r--r--drivers/edac/i82443bxgx_edac.c47
-rw-r--r--drivers/edac/i82860_edac.c24
-rw-r--r--drivers/edac/i82875p_edac.c38
-rw-r--r--drivers/edac/r82600_edac.c23
16 files changed, 560 insertions, 554 deletions
diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c
index cc392eebee5c..1c1e02e59585 100644
--- a/drivers/edac/amd76x_edac.c
+++ b/drivers/edac/amd76x_edac.c
@@ -86,9 +86,9 @@ struct amd76x_dev_info {
86 86
87static const struct amd76x_dev_info amd76x_devs[] = { 87static const struct amd76x_dev_info amd76x_devs[] = {
88 [AMD761] = { 88 [AMD761] = {
89 .ctl_name = "AMD761"}, 89 .ctl_name = "AMD761"},
90 [AMD762] = { 90 [AMD762] = {
91 .ctl_name = "AMD762"}, 91 .ctl_name = "AMD762"},
92}; 92};
93 93
94static struct edac_pci_ctl_info *amd76x_pci; 94static struct edac_pci_ctl_info *amd76x_pci;
@@ -102,13 +102,13 @@ static struct edac_pci_ctl_info *amd76x_pci;
102 * on the chip so that further errors will be reported 102 * on the chip so that further errors will be reported
103 */ 103 */
104static void amd76x_get_error_info(struct mem_ctl_info *mci, 104static void amd76x_get_error_info(struct mem_ctl_info *mci,
105 struct amd76x_error_info *info) 105 struct amd76x_error_info *info)
106{ 106{
107 struct pci_dev *pdev; 107 struct pci_dev *pdev;
108 108
109 pdev = to_pci_dev(mci->dev); 109 pdev = to_pci_dev(mci->dev);
110 pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, 110 pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS,
111 &info->ecc_mode_status); 111 &info->ecc_mode_status);
112 112
113 if (info->ecc_mode_status & BIT(8)) 113 if (info->ecc_mode_status & BIT(8))
114 pci_write_bits32(pdev, AMD76X_ECC_MODE_STATUS, 114 pci_write_bits32(pdev, AMD76X_ECC_MODE_STATUS,
@@ -130,8 +130,8 @@ static void amd76x_get_error_info(struct mem_ctl_info *mci,
130 * then attempt to handle and clean up after the error 130 * then attempt to handle and clean up after the error
131 */ 131 */
132static int amd76x_process_error_info(struct mem_ctl_info *mci, 132static int amd76x_process_error_info(struct mem_ctl_info *mci,
133 struct amd76x_error_info *info, 133 struct amd76x_error_info *info,
134 int handle_errors) 134 int handle_errors)
135{ 135{
136 int error_found; 136 int error_found;
137 u32 row; 137 u32 row;
@@ -147,7 +147,7 @@ static int amd76x_process_error_info(struct mem_ctl_info *mci,
147 if (handle_errors) { 147 if (handle_errors) {
148 row = (info->ecc_mode_status >> 4) & 0xf; 148 row = (info->ecc_mode_status >> 4) & 0xf;
149 edac_mc_handle_ue(mci, mci->csrows[row].first_page, 0, 149 edac_mc_handle_ue(mci, mci->csrows[row].first_page, 0,
150 row, mci->ctl_name); 150 row, mci->ctl_name);
151 } 151 }
152 } 152 }
153 153
@@ -160,7 +160,7 @@ static int amd76x_process_error_info(struct mem_ctl_info *mci,
160 if (handle_errors) { 160 if (handle_errors) {
161 row = info->ecc_mode_status & 0xf; 161 row = info->ecc_mode_status & 0xf;
162 edac_mc_handle_ce(mci, mci->csrows[row].first_page, 0, 162 edac_mc_handle_ce(mci, mci->csrows[row].first_page, 0,
163 0, row, 0, mci->ctl_name); 163 0, row, 0, mci->ctl_name);
164 } 164 }
165 } 165 }
166 166
@@ -183,7 +183,7 @@ static void amd76x_check(struct mem_ctl_info *mci)
183} 183}
184 184
185static void amd76x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, 185static void amd76x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
186 enum edac_type edac_mode) 186 enum edac_type edac_mode)
187{ 187{
188 struct csrow_info *csrow; 188 struct csrow_info *csrow;
189 u32 mba, mba_base, mba_mask, dms; 189 u32 mba, mba_base, mba_mask, dms;
@@ -194,7 +194,7 @@ static void amd76x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
194 194
195 /* find the DRAM Chip Select Base address and mask */ 195 /* find the DRAM Chip Select Base address and mask */
196 pci_read_config_dword(pdev, 196 pci_read_config_dword(pdev,
197 AMD76X_MEM_BASE_ADDR + (index * 4), &mba); 197 AMD76X_MEM_BASE_ADDR + (index * 4), &mba);
198 198
199 if (!(mba & BIT(0))) 199 if (!(mba & BIT(0)))
200 continue; 200 continue;
@@ -249,7 +249,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
249 mci->mtype_cap = MEM_FLAG_RDDR; 249 mci->mtype_cap = MEM_FLAG_RDDR;
250 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; 250 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
251 mci->edac_cap = ems_mode ? 251 mci->edac_cap = ems_mode ?
252 (EDAC_FLAG_EC | EDAC_FLAG_SECDED) : EDAC_FLAG_NONE; 252 (EDAC_FLAG_EC | EDAC_FLAG_SECDED) : EDAC_FLAG_NONE;
253 mci->mod_name = EDAC_MOD_STR; 253 mci->mod_name = EDAC_MOD_STR;
254 mci->mod_ver = AMD76X_REVISION; 254 mci->mod_ver = AMD76X_REVISION;
255 mci->ctl_name = amd76x_devs[dev_idx].ctl_name; 255 mci->ctl_name = amd76x_devs[dev_idx].ctl_name;
@@ -283,14 +283,14 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
283 debugf3("%s(): success\n", __func__); 283 debugf3("%s(): success\n", __func__);
284 return 0; 284 return 0;
285 285
286 fail: 286fail:
287 edac_mc_free(mci); 287 edac_mc_free(mci);
288 return -ENODEV; 288 return -ENODEV;
289} 289}
290 290
291/* returns count (>= 0), or negative on error */ 291/* returns count (>= 0), or negative on error */
292static int __devinit amd76x_init_one(struct pci_dev *pdev, 292static int __devinit amd76x_init_one(struct pci_dev *pdev,
293 const struct pci_device_id *ent) 293 const struct pci_device_id *ent)
294{ 294{
295 debugf0("%s()\n", __func__); 295 debugf0("%s()\n", __func__);
296 296
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 45c55a067c73..a041218370f9 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -204,21 +204,21 @@ struct e752x_error_info {
204 204
205static const struct e752x_dev_info e752x_devs[] = { 205static 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 [E7525] = { 210 [E7525] = {
211 .err_dev = PCI_DEVICE_ID_INTEL_7525_1_ERR, 211 .err_dev = PCI_DEVICE_ID_INTEL_7525_1_ERR,
212 .ctl_dev = PCI_DEVICE_ID_INTEL_7525_0, 212 .ctl_dev = PCI_DEVICE_ID_INTEL_7525_0,
213 .ctl_name = "E7525"}, 213 .ctl_name = "E7525"},
214 [E7320] = { 214 [E7320] = {
215 .err_dev = PCI_DEVICE_ID_INTEL_7320_1_ERR, 215 .err_dev = PCI_DEVICE_ID_INTEL_7320_1_ERR,
216 .ctl_dev = PCI_DEVICE_ID_INTEL_7320_0, 216 .ctl_dev = PCI_DEVICE_ID_INTEL_7320_0,
217 .ctl_name = "E7320"}, 217 .ctl_name = "E7320"},
218}; 218};
219 219
220static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, 220static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
221 unsigned long page) 221 unsigned long page)
222{ 222{
223 u32 remap; 223 u32 remap;
224 struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info; 224 struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info;
@@ -241,7 +241,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
241} 241}
242 242
243static void do_process_ce(struct mem_ctl_info *mci, u16 error_one, 243static void do_process_ce(struct mem_ctl_info *mci, u16 error_one,
244 u32 sec1_add, u16 sec1_syndrome) 244 u32 sec1_add, u16 sec1_syndrome)
245{ 245{
246 u32 page; 246 u32 page;
247 int row; 247 int row;
@@ -259,10 +259,10 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one,
259 /* chip select are bits 14 & 13 */ 259 /* chip select are bits 14 & 13 */
260 row = ((page >> 1) & 3); 260 row = ((page >> 1) & 3);
261 e752x_printk(KERN_WARNING, 261 e752x_printk(KERN_WARNING,
262 "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,
263 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],
264 pvt->map[4], pvt->map[5], pvt->map[6], 264 pvt->map[4], pvt->map[5], pvt->map[6],
265 pvt->map[7]); 265 pvt->map[7]);
266 266
267 /* test for channel remapping */ 267 /* test for channel remapping */
268 for (i = 0; i < 8; i++) { 268 for (i = 0; i < 8; i++) {
@@ -289,12 +289,12 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one,
289 289
290 /* e752x mc reads 34:6 of the DRAM linear address */ 290 /* e752x mc reads 34:6 of the DRAM linear address */
291 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),
292 sec1_syndrome, row, channel, "e752x CE"); 292 sec1_syndrome, row, channel, "e752x CE");
293} 293}
294 294
295static inline void process_ce(struct mem_ctl_info *mci, u16 error_one, 295static inline void process_ce(struct mem_ctl_info *mci, u16 error_one,
296 u32 sec1_add, u16 sec1_syndrome, int *error_found, 296 u32 sec1_add, u16 sec1_syndrome, int *error_found,
297 int handle_error) 297 int handle_error)
298{ 298{
299 *error_found = 1; 299 *error_found = 1;
300 300
@@ -303,7 +303,7 @@ static inline void process_ce(struct mem_ctl_info *mci, u16 error_one,
303} 303}
304 304
305static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, 305static void do_process_ue(struct mem_ctl_info *mci, u16 error_one,
306 u32 ded_add, u32 scrb_add) 306 u32 ded_add, u32 scrb_add)
307{ 307{
308 u32 error_2b, block_page; 308 u32 error_2b, block_page;
309 int row; 309 int row;
@@ -318,14 +318,14 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one,
318 block_page = error_2b >> (PAGE_SHIFT - 4); 318 block_page = error_2b >> (PAGE_SHIFT - 4);
319 319
320 row = pvt->mc_symmetric ? 320 row = pvt->mc_symmetric ?
321 /* chip select are bits 14 & 13 */ 321 /* chip select are bits 14 & 13 */
322 ((block_page >> 1) & 3) : 322 ((block_page >> 1) & 3) :
323 edac_mc_find_csrow_by_page(mci, block_page); 323 edac_mc_find_csrow_by_page(mci, block_page);
324 324
325 /* e752x mc reads 34:6 of the DRAM linear address */ 325 /* e752x mc reads 34:6 of the DRAM linear address */
326 edac_mc_handle_ue(mci, block_page, 326 edac_mc_handle_ue(mci, block_page,
327 offset_in_page(error_2b << 4), 327 offset_in_page(error_2b << 4),
328 row, "e752x UE from Read"); 328 row, "e752x UE from Read");
329 } 329 }
330 if (error_one & 0x0404) { 330 if (error_one & 0x0404) {
331 error_2b = scrb_add; 331 error_2b = scrb_add;
@@ -334,20 +334,20 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one,
334 block_page = error_2b >> (PAGE_SHIFT - 4); 334 block_page = error_2b >> (PAGE_SHIFT - 4);
335 335
336 row = pvt->mc_symmetric ? 336 row = pvt->mc_symmetric ?
337 /* chip select are bits 14 & 13 */ 337 /* chip select are bits 14 & 13 */
338 ((block_page >> 1) & 3) : 338 ((block_page >> 1) & 3) :
339 edac_mc_find_csrow_by_page(mci, block_page); 339 edac_mc_find_csrow_by_page(mci, block_page);
340 340
341 /* e752x mc reads 34:6 of the DRAM linear address */ 341 /* e752x mc reads 34:6 of the DRAM linear address */
342 edac_mc_handle_ue(mci, block_page, 342 edac_mc_handle_ue(mci, block_page,
343 offset_in_page(error_2b << 4), 343 offset_in_page(error_2b << 4),
344 row, "e752x UE from Scruber"); 344 row, "e752x UE from Scruber");
345 } 345 }
346} 346}
347 347
348static inline void process_ue(struct mem_ctl_info *mci, u16 error_one, 348static inline void process_ue(struct mem_ctl_info *mci, u16 error_one,
349 u32 ded_add, u32 scrb_add, int *error_found, 349 u32 ded_add, u32 scrb_add, int *error_found,
350 int handle_error) 350 int handle_error)
351{ 351{
352 *error_found = 1; 352 *error_found = 1;
353 353
@@ -377,15 +377,15 @@ static void do_process_ded_retry(struct mem_ctl_info *mci, u16 error,
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 ? ((page >> 1) & 3) : /* chip select are bits 14 & 13 */ 379 row = pvt->mc_symmetric ? ((page >> 1) & 3) : /* chip select are bits 14 & 13 */
380 edac_mc_find_csrow_by_page(mci, page); 380 edac_mc_find_csrow_by_page(mci, page);
381 e752x_mc_printk(mci, KERN_WARNING, 381 e752x_mc_printk(mci, KERN_WARNING,
382 "CE page 0x%lx, row %d : Memory read retry\n", 382 "CE page 0x%lx, row %d : Memory read retry\n",
383 (long unsigned int)page, row); 383 (long unsigned int)page, row);
384} 384}
385 385
386static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error, 386static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error,
387 u32 retry_add, int *error_found, 387 u32 retry_add, int *error_found,
388 int handle_error) 388 int handle_error)
389{ 389{
390 *error_found = 1; 390 *error_found = 1;
391 391
@@ -418,7 +418,7 @@ 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
@@ -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
452static inline void hub_error(int fatal, u8 errors, int *error_found, 452static 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,7 +503,7 @@ 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
@@ -517,7 +517,7 @@ static inline void sysbus_error(int fatal, u32 errors, int *error_found,
517} 517}
518 518
519static void e752x_check_hub_interface(struct e752x_error_info *info, 519static 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
@@ -550,7 +550,7 @@ static void e752x_check_hub_interface(struct e752x_error_info *info,
550} 550}
551 551
552static void e752x_check_sysbus(struct e752x_error_info *info, 552static void e752x_check_sysbus(struct e752x_error_info *info,
553 int *error_found, int handle_error) 553 int *error_found, int handle_error)
554{ 554{
555 u32 stat32, error32; 555 u32 stat32, error32;
556 556
@@ -577,7 +577,7 @@ static void e752x_check_sysbus(struct e752x_error_info *info,
577} 577}
578 578
579static void e752x_check_membuf(struct e752x_error_info *info, 579static void e752x_check_membuf(struct e752x_error_info *info,
580 int *error_found, int handle_error) 580 int *error_found, int handle_error)
581{ 581{
582 u8 stat8; 582 u8 stat8;
583 583
@@ -597,8 +597,8 @@ static void e752x_check_membuf(struct e752x_error_info *info,
597} 597}
598 598
599static void e752x_check_dram(struct mem_ctl_info *mci, 599static void e752x_check_dram(struct mem_ctl_info *mci,
600 struct e752x_error_info *info, int *error_found, 600 struct e752x_error_info *info, int *error_found,
601 int handle_error) 601 int handle_error)
602{ 602{
603 u16 error_one, error_next; 603 u16 error_one, error_next;
604 604
@@ -608,11 +608,11 @@ static void e752x_check_dram(struct mem_ctl_info *mci,
608 /* decode and report errors */ 608 /* decode and report errors */
609 if (error_one & 0x0101) /* check first error correctable */ 609 if (error_one & 0x0101) /* check first error correctable */
610 process_ce(mci, error_one, info->dram_sec1_add, 610 process_ce(mci, error_one, info->dram_sec1_add,
611 info->dram_sec1_syndrome, error_found, handle_error); 611 info->dram_sec1_syndrome, error_found, handle_error);
612 612
613 if (error_next & 0x0101) /* check next error correctable */ 613 if (error_next & 0x0101) /* check next error correctable */
614 process_ce(mci, error_next, info->dram_sec2_add, 614 process_ce(mci, error_next, info->dram_sec2_add,
615 info->dram_sec2_syndrome, error_found, handle_error); 615 info->dram_sec2_syndrome, error_found, handle_error);
616 616
617 if (error_one & 0x4040) 617 if (error_one & 0x4040)
618 process_ue_no_info_wr(mci, error_found, handle_error); 618 process_ue_no_info_wr(mci, error_found, handle_error);
@@ -622,26 +622,26 @@ static void e752x_check_dram(struct mem_ctl_info *mci,
622 622
623 if (error_one & 0x2020) 623 if (error_one & 0x2020)
624 process_ded_retry(mci, error_one, info->dram_retr_add, 624 process_ded_retry(mci, error_one, info->dram_retr_add,
625 error_found, handle_error); 625 error_found, handle_error);
626 626
627 if (error_next & 0x2020) 627 if (error_next & 0x2020)
628 process_ded_retry(mci, error_next, info->dram_retr_add, 628 process_ded_retry(mci, error_next, info->dram_retr_add,
629 error_found, handle_error); 629 error_found, handle_error);
630 630
631 if (error_one & 0x0808) 631 if (error_one & 0x0808)
632 process_threshold_ce(mci, error_one, error_found, handle_error); 632 process_threshold_ce(mci, error_one, error_found, handle_error);
633 633
634 if (error_next & 0x0808) 634 if (error_next & 0x0808)
635 process_threshold_ce(mci, error_next, error_found, 635 process_threshold_ce(mci, error_next, error_found,
636 handle_error); 636 handle_error);
637 637
638 if (error_one & 0x0606) 638 if (error_one & 0x0606)
639 process_ue(mci, error_one, info->dram_ded_add, 639 process_ue(mci, error_one, info->dram_ded_add,
640 info->dram_scrb_add, error_found, handle_error); 640 info->dram_scrb_add, error_found, handle_error);
641 641
642 if (error_next & 0x0606) 642 if (error_next & 0x0606)
643 process_ue(mci, error_next, info->dram_ded_add, 643 process_ue(mci, error_next, info->dram_ded_add,
644 info->dram_scrb_add, error_found, handle_error); 644 info->dram_scrb_add, error_found, handle_error);
645} 645}
646 646
647static void e752x_get_error_info(struct mem_ctl_info *mci, 647static void e752x_get_error_info(struct mem_ctl_info *mci,
@@ -658,38 +658,38 @@ static void e752x_get_error_info(struct mem_ctl_info *mci,
658 if (info->ferr_global) { 658 if (info->ferr_global) {
659 pci_read_config_byte(dev, E752X_HI_FERR, &info->hi_ferr); 659 pci_read_config_byte(dev, E752X_HI_FERR, &info->hi_ferr);
660 pci_read_config_word(dev, E752X_SYSBUS_FERR, 660 pci_read_config_word(dev, E752X_SYSBUS_FERR,
661 &info->sysbus_ferr); 661 &info->sysbus_ferr);
662 pci_read_config_byte(dev, E752X_BUF_FERR, &info->buf_ferr); 662 pci_read_config_byte(dev, E752X_BUF_FERR, &info->buf_ferr);
663 pci_read_config_word(dev, E752X_DRAM_FERR, &info->dram_ferr); 663 pci_read_config_word(dev, E752X_DRAM_FERR, &info->dram_ferr);
664 pci_read_config_dword(dev, E752X_DRAM_SEC1_ADD, 664 pci_read_config_dword(dev, E752X_DRAM_SEC1_ADD,
665 &info->dram_sec1_add); 665 &info->dram_sec1_add);
666 pci_read_config_word(dev, E752X_DRAM_SEC1_SYNDROME, 666 pci_read_config_word(dev, E752X_DRAM_SEC1_SYNDROME,
667 &info->dram_sec1_syndrome); 667 &info->dram_sec1_syndrome);
668 pci_read_config_dword(dev, E752X_DRAM_DED_ADD, 668 pci_read_config_dword(dev, E752X_DRAM_DED_ADD,
669 &info->dram_ded_add); 669 &info->dram_ded_add);
670 pci_read_config_dword(dev, E752X_DRAM_SCRB_ADD, 670 pci_read_config_dword(dev, E752X_DRAM_SCRB_ADD,
671 &info->dram_scrb_add); 671 &info->dram_scrb_add);
672 pci_read_config_dword(dev, E752X_DRAM_RETR_ADD, 672 pci_read_config_dword(dev, E752X_DRAM_RETR_ADD,
673 &info->dram_retr_add); 673 &info->dram_retr_add);
674 674
675 if (info->hi_ferr & 0x7f) 675 if (info->hi_ferr & 0x7f)
676 pci_write_config_byte(dev, E752X_HI_FERR, 676 pci_write_config_byte(dev, E752X_HI_FERR,
677 info->hi_ferr); 677 info->hi_ferr);
678 678
679 if (info->sysbus_ferr) 679 if (info->sysbus_ferr)
680 pci_write_config_word(dev, E752X_SYSBUS_FERR, 680 pci_write_config_word(dev, E752X_SYSBUS_FERR,
681 info->sysbus_ferr); 681 info->sysbus_ferr);
682 682
683 if (info->buf_ferr & 0x0f) 683 if (info->buf_ferr & 0x0f)
684 pci_write_config_byte(dev, E752X_BUF_FERR, 684 pci_write_config_byte(dev, E752X_BUF_FERR,
685 info->buf_ferr); 685 info->buf_ferr);
686 686
687 if (info->dram_ferr) 687 if (info->dram_ferr)
688 pci_write_bits16(pvt->bridge_ck, E752X_DRAM_FERR, 688 pci_write_bits16(pvt->bridge_ck, E752X_DRAM_FERR,
689 info->dram_ferr, info->dram_ferr); 689 info->dram_ferr, info->dram_ferr);
690 690
691 pci_write_config_dword(dev, E752X_FERR_GLOBAL, 691 pci_write_config_dword(dev, E752X_FERR_GLOBAL,
692 info->ferr_global); 692 info->ferr_global);
693 } 693 }
694 694
695 pci_read_config_dword(dev, E752X_NERR_GLOBAL, &info->nerr_global); 695 pci_read_config_dword(dev, E752X_NERR_GLOBAL, &info->nerr_global);
@@ -697,38 +697,38 @@ static void e752x_get_error_info(struct mem_ctl_info *mci,
697 if (info->nerr_global) { 697 if (info->nerr_global) {
698 pci_read_config_byte(dev, E752X_HI_NERR, &info->hi_nerr); 698 pci_read_config_byte(dev, E752X_HI_NERR, &info->hi_nerr);
699 pci_read_config_word(dev, E752X_SYSBUS_NERR, 699 pci_read_config_word(dev, E752X_SYSBUS_NERR,
700 &info->sysbus_nerr); 700 &info->sysbus_nerr);
701 pci_read_config_byte(dev, E752X_BUF_NERR, &info->buf_nerr); 701 pci_read_config_byte(dev, E752X_BUF_NERR, &info->buf_nerr);
702 pci_read_config_word(dev, E752X_DRAM_NERR, &info->dram_nerr); 702 pci_read_config_word(dev, E752X_DRAM_NERR, &info->dram_nerr);
703 pci_read_config_dword(dev, E752X_DRAM_SEC2_ADD, 703 pci_read_config_dword(dev, E752X_DRAM_SEC2_ADD,
704 &info->dram_sec2_add); 704 &info->dram_sec2_add);
705 pci_read_config_word(dev, E752X_DRAM_SEC2_SYNDROME, 705 pci_read_config_word(dev, E752X_DRAM_SEC2_SYNDROME,
706 &info->dram_sec2_syndrome); 706 &info->dram_sec2_syndrome);
707 707
708 if (info->hi_nerr & 0x7f) 708 if (info->hi_nerr & 0x7f)
709 pci_write_config_byte(dev, E752X_HI_NERR, 709 pci_write_config_byte(dev, E752X_HI_NERR,
710 info->hi_nerr); 710 info->hi_nerr);
711 711
712 if (info->sysbus_nerr) 712 if (info->sysbus_nerr)
713 pci_write_config_word(dev, E752X_SYSBUS_NERR, 713 pci_write_config_word(dev, E752X_SYSBUS_NERR,
714 info->sysbus_nerr); 714 info->sysbus_nerr);
715 715
716 if (info->buf_nerr & 0x0f) 716 if (info->buf_nerr & 0x0f)
717 pci_write_config_byte(dev, E752X_BUF_NERR, 717 pci_write_config_byte(dev, E752X_BUF_NERR,
718 info->buf_nerr); 718 info->buf_nerr);
719 719
720 if (info->dram_nerr) 720 if (info->dram_nerr)
721 pci_write_bits16(pvt->bridge_ck, E752X_DRAM_NERR, 721 pci_write_bits16(pvt->bridge_ck, E752X_DRAM_NERR,
722 info->dram_nerr, info->dram_nerr); 722 info->dram_nerr, info->dram_nerr);
723 723
724 pci_write_config_dword(dev, E752X_NERR_GLOBAL, 724 pci_write_config_dword(dev, E752X_NERR_GLOBAL,
725 info->nerr_global); 725 info->nerr_global);
726 } 726 }
727} 727}
728 728
729static int e752x_process_error_info(struct mem_ctl_info *mci, 729static int e752x_process_error_info(struct mem_ctl_info *mci,
730 struct e752x_error_info *info, 730 struct e752x_error_info *info,
731 int handle_errors) 731 int handle_errors)
732{ 732{
733 u32 error32, stat32; 733 u32 error32, stat32;
734 int error_found; 734 int error_found;
@@ -775,7 +775,7 @@ static inline int dual_channel_active(u16 ddrcsr)
775} 775}
776 776
777static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, 777static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
778 u16 ddrcsr) 778 u16 ddrcsr)
779{ 779{
780 struct csrow_info *csrow; 780 struct csrow_info *csrow;
781 unsigned long last_cumul_size; 781 unsigned long last_cumul_size;
@@ -841,7 +841,7 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
841} 841}
842 842
843static void e752x_init_mem_map_table(struct pci_dev *pdev, 843static void e752x_init_mem_map_table(struct pci_dev *pdev,
844 struct e752x_pvt *pvt) 844 struct e752x_pvt *pvt)
845{ 845{
846 int index; 846 int index;
847 u8 value, last, row, stat8; 847 u8 value, last, row, stat8;
@@ -864,11 +864,11 @@ static void e752x_init_mem_map_table(struct pci_dev *pdev,
864 * sided 864 * sided
865 */ 865 */
866 pci_read_config_byte(pdev, E752X_DRB + index + 1, 866 pci_read_config_byte(pdev, E752X_DRB + index + 1,
867 &value); 867 &value);
868 pvt->map[index + 1] = (value == last) ? 0xff : /* the dimm is single sided, 868
869 so flag as empty */ 869 /* the dimm is single sided, so flag as empty */
870 row; /* this is a double sided dimm 870 /* this is a double sided dimm to save the next row #*/
871 to save the next row # */ 871 pvt->map[index + 1] = (value == last) ? 0xff : row;
872 row++; 872 row++;
873 last = value; 873 last = value;
874 } 874 }
@@ -881,7 +881,7 @@ static void e752x_init_mem_map_table(struct pci_dev *pdev,
881 881
882/* Return 0 on success or 1 on failure. */ 882/* Return 0 on success or 1 on failure. */
883static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, 883static int e752x_get_devs(struct pci_dev *pdev, int dev_idx,
884 struct e752x_pvt *pvt) 884 struct e752x_pvt *pvt)
885{ 885{
886 struct pci_dev *dev; 886 struct pci_dev *dev;
887 887
@@ -894,13 +894,13 @@ static int e752x_get_devs(struct pci_dev *pdev, int dev_idx,
894 894
895 if (pvt->bridge_ck == NULL) { 895 if (pvt->bridge_ck == NULL) {
896 e752x_printk(KERN_ERR, "error reporting device not found:" 896 e752x_printk(KERN_ERR, "error reporting device not found:"
897 "vendor %x device 0x%x (broken BIOS?)\n", 897 "vendor %x device 0x%x (broken BIOS?)\n",
898 PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); 898 PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev);
899 return 1; 899 return 1;
900 } 900 }
901 901
902 dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev, 902 dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev,
903 NULL); 903 NULL);
904 904
905 if (dev == NULL) 905 if (dev == NULL)
906 goto fail; 906 goto fail;
@@ -910,7 +910,7 @@ static int e752x_get_devs(struct pci_dev *pdev, int dev_idx,
910 910
911 return 0; 911 return 0;
912 912
913 fail: 913fail:
914 pci_dev_put(pvt->bridge_ck); 914 pci_dev_put(pvt->bridge_ck);
915 return 1; 915 return 1;
916} 916}
@@ -961,7 +961,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
961 pci_read_config_byte(pdev, E752X_DEVPRES1, &stat8); 961 pci_read_config_byte(pdev, E752X_DEVPRES1, &stat8);
962 if (!force_function_unhide && !(stat8 & (1 << 5))) { 962 if (!force_function_unhide && !(stat8 & (1 << 5))) {
963 printk(KERN_INFO "Contact your BIOS vendor to see if the " 963 printk(KERN_INFO "Contact your BIOS vendor to see if the "
964 "E752x error registers can be safely un-hidden\n"); 964 "E752x error registers can be safely un-hidden\n");
965 return -ENOMEM; 965 return -ENOMEM;
966 } 966 }
967 stat8 |= (1 << 5); 967 stat8 |= (1 << 5);
@@ -981,7 +981,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
981 debugf3("%s(): init mci\n", __func__); 981 debugf3("%s(): init mci\n", __func__);
982 mci->mtype_cap = MEM_FLAG_RDDR; 982 mci->mtype_cap = MEM_FLAG_RDDR;
983 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED | 983 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED |
984 EDAC_FLAG_S4ECD4ED; 984 EDAC_FLAG_S4ECD4ED;
985 /* FIXME - what if different memory types are in different csrows? */ 985 /* FIXME - what if different memory types are in different csrows? */
986 mci->mod_name = EDAC_MOD_STR; 986 mci->mod_name = EDAC_MOD_STR;
987 mci->mod_ver = E752X_REVISION; 987 mci->mod_ver = E752X_REVISION;
@@ -1021,8 +1021,8 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
1021 pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data); 1021 pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data);
1022 pvt->remaplimit = ((u32) pci_data) << 14; 1022 pvt->remaplimit = ((u32) pci_data) << 14;
1023 e752x_printk(KERN_INFO, 1023 e752x_printk(KERN_INFO,
1024 "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, 1024 "tolm = %x, remapbase = %x, remaplimit = %x\n",
1025 pvt->remapbase, pvt->remaplimit); 1025 pvt->tolm, pvt->remapbase, pvt->remaplimit);
1026 1026
1027 /* 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
1028 * type of memory controller. The ID is therefore hardcoded to 0. 1028 * type of memory controller. The ID is therefore hardcoded to 0.
@@ -1039,16 +1039,17 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
1039 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);
1040 if (!e752x_pci) { 1040 if (!e752x_pci) {
1041 printk(KERN_WARNING 1041 printk(KERN_WARNING
1042 "%s(): Unable to create PCI control\n", __func__); 1042 "%s(): Unable to create PCI control\n", __func__);
1043 printk(KERN_WARNING 1043 printk(KERN_WARNING
1044 "%s(): PCI error report via EDAC not setup\n", __func__); 1044 "%s(): PCI error report via EDAC not setup\n",
1045 __func__);
1045 } 1046 }
1046 1047
1047 /* get this far and it's successful */ 1048 /* get this far and it's successful */
1048 debugf3("%s(): success\n", __func__); 1049 debugf3("%s(): success\n", __func__);
1049 return 0; 1050 return 0;
1050 1051
1051 fail: 1052fail:
1052 pci_dev_put(pvt->dev_d0f0); 1053 pci_dev_put(pvt->dev_d0f0);
1053 pci_dev_put(pvt->dev_d0f1); 1054 pci_dev_put(pvt->dev_d0f1);
1054 pci_dev_put(pvt->bridge_ck); 1055 pci_dev_put(pvt->bridge_ck);
@@ -1059,7 +1060,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
1059 1060
1060/* returns count (>= 0), or negative on error */ 1061/* returns count (>= 0), or negative on error */
1061static int __devinit e752x_init_one(struct pci_dev *pdev, 1062static int __devinit e752x_init_one(struct pci_dev *pdev,
1062 const struct pci_device_id *ent) 1063 const struct pci_device_id *ent)
1063{ 1064{
1064 debugf0("%s()\n", __func__); 1065 debugf0("%s()\n", __func__);
1065 1066
diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c
index 453ba346b6ca..0601958421fb 100644
--- a/drivers/edac/e7xxx_edac.c
+++ b/drivers/edac/e7xxx_edac.c
@@ -148,17 +148,17 @@ static struct edac_pci_ctl_info *e7xxx_pci;
148 148
149static const struct e7xxx_dev_info e7xxx_devs[] = { 149static const struct e7xxx_dev_info e7xxx_devs[] = {
150 [E7500] = { 150 [E7500] = {
151 .err_dev = PCI_DEVICE_ID_INTEL_7500_1_ERR, 151 .err_dev = PCI_DEVICE_ID_INTEL_7500_1_ERR,
152 .ctl_name = "E7500"}, 152 .ctl_name = "E7500"},
153 [E7501] = { 153 [E7501] = {
154 .err_dev = PCI_DEVICE_ID_INTEL_7501_1_ERR, 154 .err_dev = PCI_DEVICE_ID_INTEL_7501_1_ERR,
155 .ctl_name = "E7501"}, 155 .ctl_name = "E7501"},
156 [E7505] = { 156 [E7505] = {
157 .err_dev = PCI_DEVICE_ID_INTEL_7505_1_ERR, 157 .err_dev = PCI_DEVICE_ID_INTEL_7505_1_ERR,
158 .ctl_name = "E7505"}, 158 .ctl_name = "E7505"},
159 [E7205] = { 159 [E7205] = {
160 .err_dev = PCI_DEVICE_ID_INTEL_7205_1_ERR, 160 .err_dev = PCI_DEVICE_ID_INTEL_7205_1_ERR,
161 .ctl_name = "E7205"}, 161 .ctl_name = "E7205"},
162}; 162};
163 163
164/* FIXME - is this valid for both SECDED and S4ECD4ED? */ 164/* FIXME - is this valid for both SECDED and S4ECD4ED? */
@@ -179,7 +179,7 @@ static inline int e7xxx_find_channel(u16 syndrome)
179} 179}
180 180
181static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, 181static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
182 unsigned long page) 182 unsigned long page)
183{ 183{
184 u32 remap; 184 u32 remap;
185 struct e7xxx_pvt *pvt = (struct e7xxx_pvt *)mci->pvt_info; 185 struct e7xxx_pvt *pvt = (struct e7xxx_pvt *)mci->pvt_info;
@@ -187,7 +187,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
187 debugf3("%s()\n", __func__); 187 debugf3("%s()\n", __func__);
188 188
189 if ((page < pvt->tolm) || 189 if ((page < pvt->tolm) ||
190 ((page >= 0x100000) && (page < pvt->remapbase))) 190 ((page >= 0x100000) && (page < pvt->remapbase)))
191 return page; 191 return page;
192 192
193 remap = (page - pvt->tolm) + pvt->remapbase; 193 remap = (page - pvt->tolm) + pvt->remapbase;
@@ -257,15 +257,15 @@ static void e7xxx_get_error_info(struct mem_ctl_info *mci,
257 257
258 if ((info->dram_ferr & 1) || (info->dram_nerr & 1)) { 258 if ((info->dram_ferr & 1) || (info->dram_nerr & 1)) {
259 pci_read_config_dword(pvt->bridge_ck, E7XXX_DRAM_CELOG_ADD, 259 pci_read_config_dword(pvt->bridge_ck, E7XXX_DRAM_CELOG_ADD,
260 &info->dram_celog_add); 260 &info->dram_celog_add);
261 pci_read_config_word(pvt->bridge_ck, 261 pci_read_config_word(pvt->bridge_ck,
262 E7XXX_DRAM_CELOG_SYNDROME, 262 E7XXX_DRAM_CELOG_SYNDROME,
263 &info->dram_celog_syndrome); 263 &info->dram_celog_syndrome);
264 } 264 }
265 265
266 if ((info->dram_ferr & 2) || (info->dram_nerr & 2)) 266 if ((info->dram_ferr & 2) || (info->dram_nerr & 2))
267 pci_read_config_dword(pvt->bridge_ck, E7XXX_DRAM_UELOG_ADD, 267 pci_read_config_dword(pvt->bridge_ck, E7XXX_DRAM_UELOG_ADD,
268 &info->dram_uelog_add); 268 &info->dram_uelog_add);
269 269
270 if (info->dram_ferr & 3) 270 if (info->dram_ferr & 3)
271 pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_FERR, 0x03, 0x03); 271 pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_FERR, 0x03, 0x03);
@@ -275,8 +275,8 @@ static void e7xxx_get_error_info(struct mem_ctl_info *mci,
275} 275}
276 276
277static int e7xxx_process_error_info(struct mem_ctl_info *mci, 277static int e7xxx_process_error_info(struct mem_ctl_info *mci,
278 struct e7xxx_error_info *info, 278 struct e7xxx_error_info *info,
279 int handle_errors) 279 int handle_errors)
280{ 280{
281 int error_found; 281 int error_found;
282 282
@@ -345,7 +345,7 @@ static inline int drb_granularity(u32 drc, int dev_idx)
345} 345}
346 346
347static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, 347static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
348 int dev_idx, u32 drc) 348 int dev_idx, u32 drc)
349{ 349{
350 unsigned long last_cumul_size; 350 unsigned long last_cumul_size;
351 int index; 351 int index;
@@ -435,7 +435,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
435 debugf3("%s(): init mci\n", __func__); 435 debugf3("%s(): init mci\n", __func__);
436 mci->mtype_cap = MEM_FLAG_RDDR; 436 mci->mtype_cap = MEM_FLAG_RDDR;
437 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED | 437 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED |
438 EDAC_FLAG_S4ECD4ED; 438 EDAC_FLAG_S4ECD4ED;
439 /* FIXME - what if different memory types are in different csrows? */ 439 /* FIXME - what if different memory types are in different csrows? */
440 mci->mod_name = EDAC_MOD_STR; 440 mci->mod_name = EDAC_MOD_STR;
441 mci->mod_ver = E7XXX_REVISION; 441 mci->mod_ver = E7XXX_REVISION;
@@ -448,8 +448,8 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
448 448
449 if (!pvt->bridge_ck) { 449 if (!pvt->bridge_ck) {
450 e7xxx_printk(KERN_ERR, "error reporting device not found:" 450 e7xxx_printk(KERN_ERR, "error reporting device not found:"
451 "vendor %x device 0x%x (broken BIOS?)\n", 451 "vendor %x device 0x%x (broken BIOS?)\n",
452 PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev); 452 PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev);
453 goto fail0; 453 goto fail0;
454 } 454 }
455 455
@@ -469,8 +469,8 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
469 pci_read_config_word(pdev, E7XXX_REMAPLIMIT, &pci_data); 469 pci_read_config_word(pdev, E7XXX_REMAPLIMIT, &pci_data);
470 pvt->remaplimit = ((u32) pci_data) << 14; 470 pvt->remaplimit = ((u32) pci_data) << 14;
471 e7xxx_printk(KERN_INFO, 471 e7xxx_printk(KERN_INFO,
472 "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, 472 "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm,
473 pvt->remapbase, pvt->remaplimit); 473 pvt->remapbase, pvt->remaplimit);
474 474
475 /* clear any pending errors, or initial state bits */ 475 /* clear any pending errors, or initial state bits */
476 e7xxx_get_error_info(mci, &discard); 476 e7xxx_get_error_info(mci, &discard);
@@ -498,10 +498,10 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
498 debugf3("%s(): success\n", __func__); 498 debugf3("%s(): success\n", __func__);
499 return 0; 499 return 0;
500 500
501 fail1: 501fail1:
502 pci_dev_put(pvt->bridge_ck); 502 pci_dev_put(pvt->bridge_ck);
503 503
504 fail0: 504fail0:
505 edac_mc_free(mci); 505 edac_mc_free(mci);
506 506
507 return -ENODEV; 507 return -ENODEV;
@@ -509,13 +509,13 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
509 509
510/* returns count (>= 0), or negative on error */ 510/* returns count (>= 0), or negative on error */
511static int __devinit e7xxx_init_one(struct pci_dev *pdev, 511static int __devinit e7xxx_init_one(struct pci_dev *pdev,
512 const struct pci_device_id *ent) 512 const struct pci_device_id *ent)
513{ 513{
514 debugf0("%s()\n", __func__); 514 debugf0("%s()\n", __func__);
515 515
516 /* wake up and enable device */ 516 /* wake up and enable device */
517 return pci_enable_device(pdev) ? 517 return pci_enable_device(pdev) ?
518 -EIO : e7xxx_probe1(pdev, ent->driver_data); 518 -EIO : e7xxx_probe1(pdev, ent->driver_data);
519} 519}
520 520
521static void __devexit e7xxx_remove_one(struct pci_dev *pdev) 521static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
@@ -578,7 +578,7 @@ module_exit(e7xxx_exit);
578 578
579MODULE_LICENSE("GPL"); 579MODULE_LICENSE("GPL");
580MODULE_AUTHOR("Linux Networx (http://lnxi.com) Thayne Harbaugh et al\n" 580MODULE_AUTHOR("Linux Networx (http://lnxi.com) Thayne Harbaugh et al\n"
581 "Based on.work by Dan Hollis et al"); 581 "Based on.work by Dan Hollis et al");
582MODULE_DESCRIPTION("MC support for Intel e7xxx memory controllers"); 582MODULE_DESCRIPTION("MC support for Intel e7xxx memory controllers");
583module_param(edac_op_state, int, 0444); 583module_param(edac_op_state, int, 0444);
584MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); 584MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index dfdfc4bbeba8..258e146efcbd 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -94,16 +94,16 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
94 94
95 /* Calc the 'end' offset past the ctl_info structure */ 95 /* Calc the 'end' offset past the ctl_info structure */
96 dev_inst = (struct edac_device_instance *) 96 dev_inst = (struct edac_device_instance *)
97 edac_align_ptr(&dev_ctl[1], sizeof(*dev_inst)); 97 edac_align_ptr(&dev_ctl[1], sizeof(*dev_inst));
98 98
99 /* Calc the 'end' offset past the instance array */ 99 /* Calc the 'end' offset past the instance array */
100 dev_blk = (struct edac_device_block *) 100 dev_blk = (struct edac_device_block *)
101 edac_align_ptr(&dev_inst[nr_instances], sizeof(*dev_blk)); 101 edac_align_ptr(&dev_inst[nr_instances], sizeof(*dev_blk));
102 102
103 /* Calc the 'end' offset past the dev_blk array */ 103 /* Calc the 'end' offset past the dev_blk array */
104 count = nr_instances * nr_blocks; 104 count = nr_instances * nr_blocks;
105 dev_attrib = (struct edac_attrib *) 105 dev_attrib = (struct edac_attrib *)
106 edac_align_ptr(&dev_blk[count], sizeof(*dev_attrib)); 106 edac_align_ptr(&dev_blk[count], sizeof(*dev_attrib));
107 107
108 /* Check for case of NO attributes specified */ 108 /* Check for case of NO attributes specified */
109 if (nr_attribs > 0) 109 if (nr_attribs > 0)
@@ -121,11 +121,11 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
121 * rather than an imaginary chunk of memory located at address 0. 121 * rather than an imaginary chunk of memory located at address 0.
122 */ 122 */
123 dev_inst = (struct edac_device_instance *) 123 dev_inst = (struct edac_device_instance *)
124 (((char *)dev_ctl) + ((unsigned long)dev_inst)); 124 (((char *)dev_ctl) + ((unsigned long)dev_inst));
125 dev_blk = (struct edac_device_block *) 125 dev_blk = (struct edac_device_block *)
126 (((char *)dev_ctl) + ((unsigned long)dev_blk)); 126 (((char *)dev_ctl) + ((unsigned long)dev_blk));
127 dev_attrib = (struct edac_attrib *) 127 dev_attrib = (struct edac_attrib *)
128 (((char *)dev_ctl) + ((unsigned long)dev_attrib)); 128 (((char *)dev_ctl) + ((unsigned long)dev_attrib));
129 pvt = sz_private ? (((char *)dev_ctl) + ((unsigned long)pvt)) : NULL; 129 pvt = sz_private ? (((char *)dev_ctl) + ((unsigned long)pvt)) : NULL;
130 130
131 memset(dev_ctl, 0, total_size); /* clear all fields */ 131 memset(dev_ctl, 0, total_size); /* clear all fields */
@@ -257,18 +257,18 @@ static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev)
257 list_add_tail_rcu(&edac_dev->link, insert_before); 257 list_add_tail_rcu(&edac_dev->link, insert_before);
258 return 0; 258 return 0;
259 259
260 fail0: 260fail0:
261 edac_printk(KERN_WARNING, EDAC_MC, 261 edac_printk(KERN_WARNING, EDAC_MC,
262 "%s (%s) %s %s already assigned %d\n", 262 "%s (%s) %s %s already assigned %d\n",
263 rover->dev->bus_id, dev_name(rover), 263 rover->dev->bus_id, dev_name(rover),
264 rover->mod_name, rover->ctl_name, rover->dev_idx); 264 rover->mod_name, rover->ctl_name, rover->dev_idx);
265 return 1; 265 return 1;
266 266
267 fail1: 267fail1:
268 edac_printk(KERN_WARNING, EDAC_MC, 268 edac_printk(KERN_WARNING, EDAC_MC,
269 "bug in low-level driver: attempt to assign\n" 269 "bug in low-level driver: attempt to assign\n"
270 " duplicate dev_idx %d in %s()\n", rover->dev_idx, 270 " duplicate dev_idx %d in %s()\n", rover->dev_idx,
271 __func__); 271 __func__);
272 return 1; 272 return 1;
273} 273}
274 274
@@ -288,7 +288,7 @@ static void complete_edac_device_list_del(struct rcu_head *head)
288 * del_edac_device_from_global_list 288 * del_edac_device_from_global_list
289 */ 289 */
290static void del_edac_device_from_global_list(struct edac_device_ctl_info 290static void del_edac_device_from_global_list(struct edac_device_ctl_info
291 *edac_device) 291 *edac_device)
292{ 292{
293 list_del_rcu(&edac_device->link); 293 list_del_rcu(&edac_device->link);
294 init_completion(&edac_device->complete); 294 init_completion(&edac_device->complete);
@@ -342,8 +342,8 @@ static void edac_device_workq_function(struct work_struct *work_req)
342 342
343 /* Only poll controllers that are running polled and have a check */ 343 /* Only poll controllers that are running polled and have a check */
344 if ((edac_dev->op_state == OP_RUNNING_POLL) && 344 if ((edac_dev->op_state == OP_RUNNING_POLL) &&
345 (edac_dev->edac_check != NULL)) { 345 (edac_dev->edac_check != NULL)) {
346 edac_dev->edac_check(edac_dev); 346 edac_dev->edac_check(edac_dev);
347 } 347 }
348 348
349 unlock_device_list(); 349 unlock_device_list();
@@ -358,7 +358,7 @@ static void edac_device_workq_function(struct work_struct *work_req)
358 * passing in the new delay period in msec 358 * passing in the new delay period in msec
359 */ 359 */
360void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev, 360void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
361 unsigned msec) 361 unsigned msec)
362{ 362{
363 debugf0("%s()\n", __func__); 363 debugf0("%s()\n", __func__);
364 364
@@ -389,7 +389,7 @@ void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
389 */ 389 */
390 390
391void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev, 391void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
392 unsigned long value) 392 unsigned long value)
393{ 393{
394 lock_device_list(); 394 lock_device_list();
395 395
@@ -434,7 +434,7 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx)
434 /* create this instance's sysfs entries */ 434 /* create this instance's sysfs entries */
435 if (edac_device_create_sysfs(edac_dev)) { 435 if (edac_device_create_sysfs(edac_dev)) {
436 edac_device_printk(edac_dev, KERN_WARNING, 436 edac_device_printk(edac_dev, KERN_WARNING,
437 "failed to create sysfs device\n"); 437 "failed to create sysfs device\n");
438 goto fail1; 438 goto fail1;
439 } 439 }
440 440
@@ -454,21 +454,21 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx)
454 454
455 /* Report action taken */ 455 /* Report action taken */
456 edac_device_printk(edac_dev, KERN_INFO, 456 edac_device_printk(edac_dev, KERN_INFO,
457 "Giving out device to module '%s' controller '%s': DEV '%s' (%s)\n", 457 "Giving out device to module '%s' controller "
458 edac_dev->mod_name, 458 "'%s': DEV '%s' (%s)\n",
459 edac_dev->ctl_name, 459 edac_dev->mod_name,
460 dev_name(edac_dev), 460 edac_dev->ctl_name,
461 edac_op_state_toString(edac_dev->op_state) 461 dev_name(edac_dev),
462 ); 462 edac_op_state_toString(edac_dev->op_state));
463 463
464 unlock_device_list(); 464 unlock_device_list();
465 return 0; 465 return 0;
466 466
467 fail1: 467fail1:
468 /* Some error, so remove the entry from the lsit */ 468 /* Some error, so remove the entry from the lsit */
469 del_edac_device_from_global_list(edac_dev); 469 del_edac_device_from_global_list(edac_dev);
470 470
471 fail0: 471fail0:
472 unlock_device_list(); 472 unlock_device_list();
473 return 1; 473 return 1;
474} 474}
@@ -516,9 +516,9 @@ struct edac_device_ctl_info *edac_device_del_device(struct device *dev)
516 unlock_device_list(); 516 unlock_device_list();
517 517
518 edac_printk(KERN_INFO, EDAC_MC, 518 edac_printk(KERN_INFO, EDAC_MC,
519 "Removed device %d for %s %s: DEV %s\n", 519 "Removed device %d for %s %s: DEV %s\n",
520 edac_dev->dev_idx, 520 edac_dev->dev_idx,
521 edac_dev->mod_name, edac_dev->ctl_name, dev_name(edac_dev)); 521 edac_dev->mod_name, edac_dev->ctl_name, dev_name(edac_dev));
522 522
523 return edac_dev; 523 return edac_dev;
524} 524}
@@ -536,7 +536,7 @@ static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev)
536} 536}
537 537
538static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info 538static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info
539 *edac_dev) 539 *edac_dev)
540{ 540{
541 return edac_dev->panic_on_ue; 541 return edac_dev->panic_on_ue;
542} 542}
@@ -546,16 +546,16 @@ static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info
546 * perform a common output and handling of an 'edac_dev' CE event 546 * perform a common output and handling of an 'edac_dev' CE event
547 */ 547 */
548void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, 548void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
549 int inst_nr, int block_nr, const char *msg) 549 int inst_nr, int block_nr, const char *msg)
550{ 550{
551 struct edac_device_instance *instance; 551 struct edac_device_instance *instance;
552 struct edac_device_block *block = NULL; 552 struct edac_device_block *block = NULL;
553 553
554 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { 554 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
555 edac_device_printk(edac_dev, KERN_ERR, 555 edac_device_printk(edac_dev, KERN_ERR,
556 "INTERNAL ERROR: 'instance' out of range " 556 "INTERNAL ERROR: 'instance' out of range "
557 "(%d >= %d)\n", inst_nr, 557 "(%d >= %d)\n", inst_nr,
558 edac_dev->nr_instances); 558 edac_dev->nr_instances);
559 return; 559 return;
560 } 560 }
561 561
@@ -563,9 +563,10 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
563 563
564 if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) { 564 if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
565 edac_device_printk(edac_dev, KERN_ERR, 565 edac_device_printk(edac_dev, KERN_ERR,
566 "INTERNAL ERROR: instance %d 'block' out of range " 566 "INTERNAL ERROR: instance %d 'block' "
567 "(%d >= %d)\n", inst_nr, block_nr, 567 "out of range (%d >= %d)\n",
568 instance->nr_blocks); 568 inst_nr, block_nr,
569 instance->nr_blocks);
569 return; 570 return;
570 } 571 }
571 572
@@ -580,9 +581,9 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
580 581
581 if (edac_device_get_log_ce(edac_dev)) 582 if (edac_device_get_log_ce(edac_dev))
582 edac_device_printk(edac_dev, KERN_WARNING, 583 edac_device_printk(edac_dev, KERN_WARNING,
583 "CE: %s instance: %s block: %s '%s'\n", 584 "CE: %s instance: %s block: %s '%s'\n",
584 edac_dev->ctl_name, instance->name, 585 edac_dev->ctl_name, instance->name,
585 block ? block->name : "N/A", msg); 586 block ? block->name : "N/A", msg);
586} 587}
587 588
588EXPORT_SYMBOL_GPL(edac_device_handle_ce); 589EXPORT_SYMBOL_GPL(edac_device_handle_ce);
@@ -592,16 +593,16 @@ EXPORT_SYMBOL_GPL(edac_device_handle_ce);
592 * perform a common output and handling of an 'edac_dev' UE event 593 * perform a common output and handling of an 'edac_dev' UE event
593 */ 594 */
594void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, 595void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
595 int inst_nr, int block_nr, const char *msg) 596 int inst_nr, int block_nr, const char *msg)
596{ 597{
597 struct edac_device_instance *instance; 598 struct edac_device_instance *instance;
598 struct edac_device_block *block = NULL; 599 struct edac_device_block *block = NULL;
599 600
600 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { 601 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
601 edac_device_printk(edac_dev, KERN_ERR, 602 edac_device_printk(edac_dev, KERN_ERR,
602 "INTERNAL ERROR: 'instance' out of range " 603 "INTERNAL ERROR: 'instance' out of range "
603 "(%d >= %d)\n", inst_nr, 604 "(%d >= %d)\n", inst_nr,
604 edac_dev->nr_instances); 605 edac_dev->nr_instances);
605 return; 606 return;
606 } 607 }
607 608
@@ -609,9 +610,10 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
609 610
610 if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) { 611 if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
611 edac_device_printk(edac_dev, KERN_ERR, 612 edac_device_printk(edac_dev, KERN_ERR,
612 "INTERNAL ERROR: instance %d 'block' out of range " 613 "INTERNAL ERROR: instance %d 'block' "
613 "(%d >= %d)\n", inst_nr, block_nr, 614 "out of range (%d >= %d)\n",
614 instance->nr_blocks); 615 inst_nr, block_nr,
616 instance->nr_blocks);
615 return; 617 return;
616 } 618 }
617 619
@@ -626,14 +628,14 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
626 628
627 if (edac_device_get_log_ue(edac_dev)) 629 if (edac_device_get_log_ue(edac_dev))
628 edac_device_printk(edac_dev, KERN_EMERG, 630 edac_device_printk(edac_dev, KERN_EMERG,
629 "UE: %s instance: %s block: %s '%s'\n", 631 "UE: %s instance: %s block: %s '%s'\n",
630 edac_dev->ctl_name, instance->name, 632 edac_dev->ctl_name, instance->name,
631 block ? block->name : "N/A", msg); 633 block ? block->name : "N/A", msg);
632 634
633 if (edac_device_get_panic_on_ue(edac_dev)) 635 if (edac_device_get_panic_on_ue(edac_dev))
634 panic("EDAC %s: UE instance: %s block %s '%s'\n", 636 panic("EDAC %s: UE instance: %s block %s '%s'\n",
635 edac_dev->ctl_name, instance->name, 637 edac_dev->ctl_name, instance->name,
636 block ? block->name : "N/A", msg); 638 block ? block->name : "N/A", msg);
637} 639}
638 640
639EXPORT_SYMBOL_GPL(edac_device_handle_ue); 641EXPORT_SYMBOL_GPL(edac_device_handle_ue);
diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
index 32b2a8e53dc7..5bf7cbab27d4 100644
--- a/drivers/edac/edac_device_sysfs.c
+++ b/drivers/edac/edac_device_sysfs.c
@@ -27,14 +27,14 @@
27 27
28/* 'log_ue' */ 28/* 'log_ue' */
29static ssize_t edac_device_ctl_log_ue_show(struct edac_device_ctl_info 29static ssize_t edac_device_ctl_log_ue_show(struct edac_device_ctl_info
30 *ctl_info, char *data) 30 *ctl_info, char *data)
31{ 31{
32 return sprintf(data, "%u\n", ctl_info->log_ue); 32 return sprintf(data, "%u\n", ctl_info->log_ue);
33} 33}
34 34
35static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info 35static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info
36 *ctl_info, const char *data, 36 *ctl_info, const char *data,
37 size_t count) 37 size_t count)
38{ 38{
39 /* if parameter is zero, turn off flag, if non-zero turn on flag */ 39 /* if parameter is zero, turn off flag, if non-zero turn on flag */
40 ctl_info->log_ue = (simple_strtoul(data, NULL, 0) != 0); 40 ctl_info->log_ue = (simple_strtoul(data, NULL, 0) != 0);
@@ -44,14 +44,14 @@ static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info
44 44
45/* 'log_ce' */ 45/* 'log_ce' */
46static ssize_t edac_device_ctl_log_ce_show(struct edac_device_ctl_info 46static ssize_t edac_device_ctl_log_ce_show(struct edac_device_ctl_info
47 *ctl_info, char *data) 47 *ctl_info, char *data)
48{ 48{
49 return sprintf(data, "%u\n", ctl_info->log_ce); 49 return sprintf(data, "%u\n", ctl_info->log_ce);
50} 50}
51 51
52static ssize_t edac_device_ctl_log_ce_store(struct edac_device_ctl_info 52static ssize_t edac_device_ctl_log_ce_store(struct edac_device_ctl_info
53 *ctl_info, const char *data, 53 *ctl_info, const char *data,
54 size_t count) 54 size_t count)
55{ 55{
56 /* if parameter is zero, turn off flag, if non-zero turn on flag */ 56 /* if parameter is zero, turn off flag, if non-zero turn on flag */
57 ctl_info->log_ce = (simple_strtoul(data, NULL, 0) != 0); 57 ctl_info->log_ce = (simple_strtoul(data, NULL, 0) != 0);
@@ -78,14 +78,14 @@ static ssize_t edac_device_ctl_panic_on_ue_store(struct edac_device_ctl_info
78 78
79/* 'poll_msec' show and store functions*/ 79/* 'poll_msec' show and store functions*/
80static ssize_t edac_device_ctl_poll_msec_show(struct edac_device_ctl_info 80static ssize_t edac_device_ctl_poll_msec_show(struct edac_device_ctl_info
81 *ctl_info, char *data) 81 *ctl_info, char *data)
82{ 82{
83 return sprintf(data, "%u\n", ctl_info->poll_msec); 83 return sprintf(data, "%u\n", ctl_info->poll_msec);
84} 84}
85 85
86static ssize_t edac_device_ctl_poll_msec_store(struct edac_device_ctl_info 86static ssize_t edac_device_ctl_poll_msec_store(struct edac_device_ctl_info
87 *ctl_info, const char *data, 87 *ctl_info, const char *data,
88 size_t count) 88 size_t count)
89{ 89{
90 unsigned long value; 90 unsigned long value;
91 91
@@ -112,7 +112,7 @@ struct ctl_info_attribute {
112 112
113/* Function to 'show' fields from the edac_dev 'ctl_info' structure */ 113/* Function to 'show' fields from the edac_dev 'ctl_info' structure */
114static ssize_t edac_dev_ctl_info_show(struct kobject *kobj, 114static ssize_t edac_dev_ctl_info_show(struct kobject *kobj,
115 struct attribute *attr, char *buffer) 115 struct attribute *attr, char *buffer)
116{ 116{
117 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj); 117 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj);
118 struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr); 118 struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr);
@@ -124,8 +124,8 @@ static ssize_t edac_dev_ctl_info_show(struct kobject *kobj,
124 124
125/* Function to 'store' fields into the edac_dev 'ctl_info' structure */ 125/* Function to 'store' fields into the edac_dev 'ctl_info' structure */
126static ssize_t edac_dev_ctl_info_store(struct kobject *kobj, 126static ssize_t edac_dev_ctl_info_store(struct kobject *kobj,
127 struct attribute *attr, 127 struct attribute *attr,
128 const char *buffer, size_t count) 128 const char *buffer, size_t count)
129{ 129{
130 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj); 130 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj);
131 struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr); 131 struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr);
@@ -143,21 +143,21 @@ static struct sysfs_ops device_ctl_info_ops = {
143 143
144#define CTL_INFO_ATTR(_name,_mode,_show,_store) \ 144#define CTL_INFO_ATTR(_name,_mode,_show,_store) \
145static struct ctl_info_attribute attr_ctl_info_##_name = { \ 145static struct ctl_info_attribute attr_ctl_info_##_name = { \
146 .attr = {.name = __stringify(_name), .mode = _mode }, \ 146 .attr = {.name = __stringify(_name), .mode = _mode }, \
147 .show = _show, \ 147 .show = _show, \
148 .store = _store, \ 148 .store = _store, \
149}; 149};
150 150
151/* Declare the various ctl_info attributes here and their respective ops */ 151/* Declare the various ctl_info attributes here and their respective ops */
152CTL_INFO_ATTR(log_ue, S_IRUGO | S_IWUSR, 152CTL_INFO_ATTR(log_ue, S_IRUGO | S_IWUSR,
153 edac_device_ctl_log_ue_show, edac_device_ctl_log_ue_store); 153 edac_device_ctl_log_ue_show, edac_device_ctl_log_ue_store);
154CTL_INFO_ATTR(log_ce, S_IRUGO | S_IWUSR, 154CTL_INFO_ATTR(log_ce, S_IRUGO | S_IWUSR,
155 edac_device_ctl_log_ce_show, edac_device_ctl_log_ce_store); 155 edac_device_ctl_log_ce_show, edac_device_ctl_log_ce_store);
156CTL_INFO_ATTR(panic_on_ue, S_IRUGO | S_IWUSR, 156CTL_INFO_ATTR(panic_on_ue, S_IRUGO | S_IWUSR,
157 edac_device_ctl_panic_on_ue_show, 157 edac_device_ctl_panic_on_ue_show,
158 edac_device_ctl_panic_on_ue_store); 158 edac_device_ctl_panic_on_ue_store);
159CTL_INFO_ATTR(poll_msec, S_IRUGO | S_IWUSR, 159CTL_INFO_ATTR(poll_msec, S_IRUGO | S_IWUSR,
160 edac_device_ctl_poll_msec_show, edac_device_ctl_poll_msec_store); 160 edac_device_ctl_poll_msec_show, edac_device_ctl_poll_msec_store);
161 161
162/* Base Attributes of the EDAC_DEVICE ECC object */ 162/* Base Attributes of the EDAC_DEVICE ECC object */
163static struct ctl_info_attribute *device_ctrl_attr[] = { 163static struct ctl_info_attribute *device_ctrl_attr[] = {
@@ -242,7 +242,7 @@ static int edac_device_register_main_kobj(struct edac_device_ctl_info *edac_dev)
242 * the '..../edac/<name>' kobject 242 * the '..../edac/<name>' kobject
243 */ 243 */
244static void edac_device_unregister_main_kobj(struct edac_device_ctl_info 244static void edac_device_unregister_main_kobj(struct edac_device_ctl_info
245 *edac_dev) 245 *edac_dev)
246{ 246{
247 debugf0("%s()\n", __func__); 247 debugf0("%s()\n", __func__);
248 debugf1("%s() name of kobject is: %s\n", 248 debugf1("%s() name of kobject is: %s\n",
@@ -264,13 +264,13 @@ static void edac_device_unregister_main_kobj(struct edac_device_ctl_info
264 * Set of low-level instance attribute show functions 264 * Set of low-level instance attribute show functions
265 */ 265 */
266static ssize_t instance_ue_count_show(struct edac_device_instance *instance, 266static ssize_t instance_ue_count_show(struct edac_device_instance *instance,
267 char *data) 267 char *data)
268{ 268{
269 return sprintf(data, "%u\n", instance->counters.ue_count); 269 return sprintf(data, "%u\n", instance->counters.ue_count);
270} 270}
271 271
272static ssize_t instance_ce_count_show(struct edac_device_instance *instance, 272static ssize_t instance_ce_count_show(struct edac_device_instance *instance,
273 char *data) 273 char *data)
274{ 274{
275 return sprintf(data, "%u\n", instance->counters.ce_count); 275 return sprintf(data, "%u\n", instance->counters.ce_count);
276} 276}
@@ -298,7 +298,7 @@ struct instance_attribute {
298 298
299/* Function to 'show' fields from the edac_dev 'instance' structure */ 299/* Function to 'show' fields from the edac_dev 'instance' structure */
300static ssize_t edac_dev_instance_show(struct kobject *kobj, 300static ssize_t edac_dev_instance_show(struct kobject *kobj,
301 struct attribute *attr, char *buffer) 301 struct attribute *attr, char *buffer)
302{ 302{
303 struct edac_device_instance *instance = to_instance(kobj); 303 struct edac_device_instance *instance = to_instance(kobj);
304 struct instance_attribute *instance_attr = to_instance_attr(attr); 304 struct instance_attribute *instance_attr = to_instance_attr(attr);
@@ -310,8 +310,8 @@ static ssize_t edac_dev_instance_show(struct kobject *kobj,
310 310
311/* Function to 'store' fields into the edac_dev 'instance' structure */ 311/* Function to 'store' fields into the edac_dev 'instance' structure */
312static ssize_t edac_dev_instance_store(struct kobject *kobj, 312static ssize_t edac_dev_instance_store(struct kobject *kobj,
313 struct attribute *attr, 313 struct attribute *attr,
314 const char *buffer, size_t count) 314 const char *buffer, size_t count)
315{ 315{
316 struct edac_device_instance *instance = to_instance(kobj); 316 struct edac_device_instance *instance = to_instance(kobj);
317 struct instance_attribute *instance_attr = to_instance_attr(attr); 317 struct instance_attribute *instance_attr = to_instance_attr(attr);
@@ -329,9 +329,9 @@ static struct sysfs_ops device_instance_ops = {
329 329
330#define INSTANCE_ATTR(_name,_mode,_show,_store) \ 330#define INSTANCE_ATTR(_name,_mode,_show,_store) \
331static struct instance_attribute attr_instance_##_name = { \ 331static struct instance_attribute attr_instance_##_name = { \
332 .attr = {.name = __stringify(_name), .mode = _mode }, \ 332 .attr = {.name = __stringify(_name), .mode = _mode }, \
333 .show = _show, \ 333 .show = _show, \
334 .store = _store, \ 334 .store = _store, \
335}; 335};
336 336
337/* 337/*
@@ -394,7 +394,7 @@ struct block_attribute {
394 394
395/* Function to 'show' fields from the edac_dev 'block' structure */ 395/* Function to 'show' fields from the edac_dev 'block' structure */
396static ssize_t edac_dev_block_show(struct kobject *kobj, 396static ssize_t edac_dev_block_show(struct kobject *kobj,
397 struct attribute *attr, char *buffer) 397 struct attribute *attr, char *buffer)
398{ 398{
399 struct edac_device_block *block = to_block(kobj); 399 struct edac_device_block *block = to_block(kobj);
400 struct block_attribute *block_attr = to_block_attr(attr); 400 struct block_attribute *block_attr = to_block_attr(attr);
@@ -406,8 +406,8 @@ static ssize_t edac_dev_block_show(struct kobject *kobj,
406 406
407/* Function to 'store' fields into the edac_dev 'block' structure */ 407/* Function to 'store' fields into the edac_dev 'block' structure */
408static ssize_t edac_dev_block_store(struct kobject *kobj, 408static ssize_t edac_dev_block_store(struct kobject *kobj,
409 struct attribute *attr, 409 struct attribute *attr,
410 const char *buffer, size_t count) 410 const char *buffer, size_t count)
411{ 411{
412 struct edac_device_block *block = to_block(kobj); 412 struct edac_device_block *block = to_block(kobj);
413 struct block_attribute *block_attr = to_block_attr(attr); 413 struct block_attribute *block_attr = to_block_attr(attr);
@@ -425,9 +425,9 @@ static struct sysfs_ops device_block_ops = {
425 425
426#define BLOCK_ATTR(_name,_mode,_show,_store) \ 426#define BLOCK_ATTR(_name,_mode,_show,_store) \
427static struct block_attribute attr_block_##_name = { \ 427static struct block_attribute attr_block_##_name = { \
428 .attr = {.name = __stringify(_name), .mode = _mode }, \ 428 .attr = {.name = __stringify(_name), .mode = _mode }, \
429 .show = _show, \ 429 .show = _show, \
430 .store = _store, \ 430 .store = _store, \
431}; 431};
432 432
433BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL); 433BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL);
@@ -453,8 +453,8 @@ static struct kobj_type ktype_block_ctrl = {
453 * edac_device_create_block 453 * edac_device_create_block
454 */ 454 */
455static int edac_device_create_block(struct edac_device_ctl_info *edac_dev, 455static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
456 struct edac_device_instance *instance, 456 struct edac_device_instance *instance,
457 int idx) 457 int idx)
458{ 458{
459 int err; 459 int err;
460 struct edac_device_block *block; 460 struct edac_device_block *block;
@@ -487,8 +487,8 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
487 * edac_device_delete_block(edac_dev,j); 487 * edac_device_delete_block(edac_dev,j);
488 */ 488 */
489static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev, 489static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev,
490 struct edac_device_instance *instance, 490 struct edac_device_instance *instance,
491 int idx) 491 int idx)
492{ 492{
493 struct edac_device_block *block; 493 struct edac_device_block *block;
494 494
@@ -507,7 +507,7 @@ static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev,
507 * create just one instance of an edac_device 'instance' 507 * create just one instance of an edac_device 'instance'
508 */ 508 */
509static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev, 509static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev,
510 int idx) 510 int idx)
511{ 511{
512 int i, j; 512 int i, j;
513 int err; 513 int err;
@@ -627,22 +627,22 @@ static int edac_device_add_sysfs_attributes(
627 struct edac_device_ctl_info *edac_dev) 627 struct edac_device_ctl_info *edac_dev)
628{ 628{
629 int err; 629 int err;
630 struct edac_dev_sysfs_attribute *sysfs_attrib; 630 struct edac_dev_sysfs_attribute *sysfs_attrib;
631 631
632 /* point to the start of the array and iterate over it 632 /* point to the start of the array and iterate over it
633 * adding each attribute listed to this mci instance's kobject 633 * adding each attribute listed to this mci instance's kobject
634 */ 634 */
635 sysfs_attrib = edac_dev->sysfs_attributes; 635 sysfs_attrib = edac_dev->sysfs_attributes;
636 636
637 while (sysfs_attrib->attr.name != NULL) { 637 while (sysfs_attrib->attr.name != NULL) {
638 err = sysfs_create_file(&edac_dev->kobj, 638 err = sysfs_create_file(&edac_dev->kobj,
639 (struct attribute*) sysfs_attrib); 639 (struct attribute*) sysfs_attrib);
640 if (err) { 640 if (err) {
641 return err; 641 return err;
642 } 642 }
643 643
644 sysfs_attrib++; 644 sysfs_attrib++;
645 } 645 }
646 646
647 return 0; 647 return 0;
648} 648}
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index ce12d9b5ab18..219e861eb3f9 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -129,7 +129,7 @@ char *edac_align_ptr(void *ptr, unsigned size)
129 * struct mem_ctl_info pointer 129 * struct mem_ctl_info pointer
130 */ 130 */
131struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows, 131struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
132 unsigned nr_chans) 132 unsigned nr_chans)
133{ 133{
134 struct mem_ctl_info *mci; 134 struct mem_ctl_info *mci;
135 struct csrow_info *csi, *csrow; 135 struct csrow_info *csi, *csrow;
@@ -146,7 +146,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
146 mci = (struct mem_ctl_info *)0; 146 mci = (struct mem_ctl_info *)0;
147 csi = (struct csrow_info *)edac_align_ptr(&mci[1], sizeof(*csi)); 147 csi = (struct csrow_info *)edac_align_ptr(&mci[1], sizeof(*csi));
148 chi = (struct channel_info *) 148 chi = (struct channel_info *)
149 edac_align_ptr(&csi[nr_csrows], sizeof(*chi)); 149 edac_align_ptr(&csi[nr_csrows], sizeof(*chi));
150 pvt = edac_align_ptr(&chi[nr_chans * nr_csrows], sz_pvt); 150 pvt = edac_align_ptr(&chi[nr_chans * nr_csrows], sz_pvt);
151 size = ((unsigned long)pvt) + sz_pvt; 151 size = ((unsigned long)pvt) + sz_pvt;
152 152
@@ -256,7 +256,7 @@ static void edac_mc_workq_function(struct work_struct *work_req)
256 256
257 /* Reschedule */ 257 /* Reschedule */
258 queue_delayed_work(edac_workqueue, &mci->work, 258 queue_delayed_work(edac_workqueue, &mci->work,
259 msecs_to_jiffies(edac_mc_get_poll_msec())); 259 msecs_to_jiffies(edac_mc_get_poll_msec()));
260} 260}
261 261
262/* 262/*
@@ -334,16 +334,16 @@ static int add_mc_to_global_list(struct mem_ctl_info *mci)
334 atomic_inc(&edac_handlers); 334 atomic_inc(&edac_handlers);
335 return 0; 335 return 0;
336 336
337 fail0: 337fail0:
338 edac_printk(KERN_WARNING, EDAC_MC, 338 edac_printk(KERN_WARNING, EDAC_MC,
339 "%s (%s) %s %s already assigned %d\n", p->dev->bus_id, 339 "%s (%s) %s %s already assigned %d\n", p->dev->bus_id,
340 dev_name(mci), p->mod_name, p->ctl_name, p->mc_idx); 340 dev_name(mci), p->mod_name, p->ctl_name, p->mc_idx);
341 return 1; 341 return 1;
342 342
343 fail1: 343fail1:
344 edac_printk(KERN_WARNING, EDAC_MC, 344 edac_printk(KERN_WARNING, EDAC_MC,
345 "bug in low-level driver: attempt to assign\n" 345 "bug in low-level driver: attempt to assign\n"
346 " duplicate mc_idx %d in %s()\n", p->mc_idx, __func__); 346 " duplicate mc_idx %d in %s()\n", p->mc_idx, __func__);
347 return 1; 347 return 1;
348} 348}
349 349
@@ -423,7 +423,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx)
423 edac_mc_dump_csrow(&mci->csrows[i]); 423 edac_mc_dump_csrow(&mci->csrows[i]);
424 for (j = 0; j < mci->csrows[i].nr_channels; j++) 424 for (j = 0; j < mci->csrows[i].nr_channels; j++)
425 edac_mc_dump_channel(&mci->csrows[i]. 425 edac_mc_dump_channel(&mci->csrows[i].
426 channels[j]); 426 channels[j]);
427 } 427 }
428 } 428 }
429#endif 429#endif
@@ -437,7 +437,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx)
437 437
438 if (edac_create_sysfs_mci_device(mci)) { 438 if (edac_create_sysfs_mci_device(mci)) {
439 edac_mc_printk(mci, KERN_WARNING, 439 edac_mc_printk(mci, KERN_WARNING,
440 "failed to create sysfs device\n"); 440 "failed to create sysfs device\n");
441 goto fail1; 441 goto fail1;
442 } 442 }
443 443
@@ -453,15 +453,15 @@ int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx)
453 453
454 /* Report action taken */ 454 /* Report action taken */
455 edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: DEV %s\n", 455 edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: DEV %s\n",
456 mci->mod_name, mci->ctl_name, dev_name(mci)); 456 mci->mod_name, mci->ctl_name, dev_name(mci));
457 457
458 mutex_unlock(&mem_ctls_mutex); 458 mutex_unlock(&mem_ctls_mutex);
459 return 0; 459 return 0;
460 460
461 fail1: 461fail1:
462 del_mc_from_global_list(mci); 462 del_mc_from_global_list(mci);
463 463
464 fail0: 464fail0:
465 mutex_unlock(&mem_ctls_mutex); 465 mutex_unlock(&mem_ctls_mutex);
466 return 1; 466 return 1;
467} 467}
@@ -497,8 +497,8 @@ struct mem_ctl_info *edac_mc_del_mc(struct device *dev)
497 del_mc_from_global_list(mci); 497 del_mc_from_global_list(mci);
498 mutex_unlock(&mem_ctls_mutex); 498 mutex_unlock(&mem_ctls_mutex);
499 edac_printk(KERN_INFO, EDAC_MC, 499 edac_printk(KERN_INFO, EDAC_MC,
500 "Removed device %d for %s %s: DEV %s\n", mci->mc_idx, 500 "Removed device %d for %s %s: DEV %s\n", mci->mc_idx,
501 mci->mod_name, mci->ctl_name, dev_name(mci)); 501 mci->mod_name, mci->ctl_name, dev_name(mci));
502 return mci; 502 return mci;
503} 503}
504 504
@@ -566,8 +566,8 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, unsigned long page)
566 566
567 if (row == -1) 567 if (row == -1)
568 edac_mc_printk(mci, KERN_ERR, 568 edac_mc_printk(mci, KERN_ERR,
569 "could not look up page error address %lx\n", 569 "could not look up page error address %lx\n",
570 (unsigned long)page); 570 (unsigned long)page);
571 571
572 return row; 572 return row;
573} 573}
@@ -577,9 +577,9 @@ EXPORT_SYMBOL_GPL(edac_mc_find_csrow_by_page);
577/* FIXME - setable log (warning/emerg) levels */ 577/* FIXME - setable log (warning/emerg) levels */
578/* FIXME - integrate with evlog: http://evlog.sourceforge.net/ */ 578/* FIXME - integrate with evlog: http://evlog.sourceforge.net/ */
579void edac_mc_handle_ce(struct mem_ctl_info *mci, 579void edac_mc_handle_ce(struct mem_ctl_info *mci,
580 unsigned long page_frame_number, 580 unsigned long page_frame_number,
581 unsigned long offset_in_page, unsigned long syndrome, 581 unsigned long offset_in_page, unsigned long syndrome,
582 int row, int channel, const char *msg) 582 int row, int channel, const char *msg)
583{ 583{
584 unsigned long remapped_page; 584 unsigned long remapped_page;
585 585
@@ -589,8 +589,8 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci,
589 if (row >= mci->nr_csrows || row < 0) { 589 if (row >= mci->nr_csrows || row < 0) {
590 /* something is wrong */ 590 /* something is wrong */
591 edac_mc_printk(mci, KERN_ERR, 591 edac_mc_printk(mci, KERN_ERR,
592 "INTERNAL ERROR: row out of range " 592 "INTERNAL ERROR: row out of range "
593 "(%d >= %d)\n", row, mci->nr_csrows); 593 "(%d >= %d)\n", row, mci->nr_csrows);
594 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); 594 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
595 return; 595 return;
596 } 596 }
@@ -598,9 +598,9 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci,
598 if (channel >= mci->csrows[row].nr_channels || channel < 0) { 598 if (channel >= mci->csrows[row].nr_channels || channel < 0) {
599 /* something is wrong */ 599 /* something is wrong */
600 edac_mc_printk(mci, KERN_ERR, 600 edac_mc_printk(mci, KERN_ERR,
601 "INTERNAL ERROR: channel out of range " 601 "INTERNAL ERROR: channel out of range "
602 "(%d >= %d)\n", channel, 602 "(%d >= %d)\n", channel,
603 mci->csrows[row].nr_channels); 603 mci->csrows[row].nr_channels);
604 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); 604 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
605 return; 605 return;
606 } 606 }
@@ -608,11 +608,11 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci,
608 if (edac_mc_get_log_ce()) 608 if (edac_mc_get_log_ce())
609 /* FIXME - put in DIMM location */ 609 /* FIXME - put in DIMM location */
610 edac_mc_printk(mci, KERN_WARNING, 610 edac_mc_printk(mci, KERN_WARNING,
611 "CE page 0x%lx, offset 0x%lx, grain %d, syndrome " 611 "CE page 0x%lx, offset 0x%lx, grain %d, syndrome "
612 "0x%lx, row %d, channel %d, label \"%s\": %s\n", 612 "0x%lx, row %d, channel %d, label \"%s\": %s\n",
613 page_frame_number, offset_in_page, 613 page_frame_number, offset_in_page,
614 mci->csrows[row].grain, syndrome, row, channel, 614 mci->csrows[row].grain, syndrome, row, channel,
615 mci->csrows[row].channels[channel].label, msg); 615 mci->csrows[row].channels[channel].label, msg);
616 616
617 mci->ce_count++; 617 mci->ce_count++;
618 mci->csrows[row].ce_count++; 618 mci->csrows[row].ce_count++;
@@ -629,11 +629,11 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci,
629 * page - which can then be scrubbed. 629 * page - which can then be scrubbed.
630 */ 630 */
631 remapped_page = mci->ctl_page_to_phys ? 631 remapped_page = mci->ctl_page_to_phys ?
632 mci->ctl_page_to_phys(mci, page_frame_number) : 632 mci->ctl_page_to_phys(mci, page_frame_number) :
633 page_frame_number; 633 page_frame_number;
634 634
635 edac_mc_scrub_block(remapped_page, offset_in_page, 635 edac_mc_scrub_block(remapped_page, offset_in_page,
636 mci->csrows[row].grain); 636 mci->csrows[row].grain);
637 } 637 }
638} 638}
639 639
@@ -643,7 +643,7 @@ void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg)
643{ 643{
644 if (edac_mc_get_log_ce()) 644 if (edac_mc_get_log_ce())
645 edac_mc_printk(mci, KERN_WARNING, 645 edac_mc_printk(mci, KERN_WARNING,
646 "CE - no information available: %s\n", msg); 646 "CE - no information available: %s\n", msg);
647 647
648 mci->ce_noinfo_count++; 648 mci->ce_noinfo_count++;
649 mci->ce_count++; 649 mci->ce_count++;
@@ -652,8 +652,8 @@ void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg)
652EXPORT_SYMBOL_GPL(edac_mc_handle_ce_no_info); 652EXPORT_SYMBOL_GPL(edac_mc_handle_ce_no_info);
653 653
654void edac_mc_handle_ue(struct mem_ctl_info *mci, 654void edac_mc_handle_ue(struct mem_ctl_info *mci,
655 unsigned long page_frame_number, 655 unsigned long page_frame_number,
656 unsigned long offset_in_page, int row, const char *msg) 656 unsigned long offset_in_page, int row, const char *msg)
657{ 657{
658 int len = EDAC_MC_LABEL_LEN * 4; 658 int len = EDAC_MC_LABEL_LEN * 4;
659 char labels[len + 1]; 659 char labels[len + 1];
@@ -667,8 +667,8 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
667 if (row >= mci->nr_csrows || row < 0) { 667 if (row >= mci->nr_csrows || row < 0) {
668 /* something is wrong */ 668 /* something is wrong */
669 edac_mc_printk(mci, KERN_ERR, 669 edac_mc_printk(mci, KERN_ERR,
670 "INTERNAL ERROR: row out of range " 670 "INTERNAL ERROR: row out of range "
671 "(%d >= %d)\n", row, mci->nr_csrows); 671 "(%d >= %d)\n", row, mci->nr_csrows);
672 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); 672 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR");
673 return; 673 return;
674 } 674 }
@@ -679,7 +679,7 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
679 pos += chars; 679 pos += chars;
680 680
681 for (chan = 1; (chan < mci->csrows[row].nr_channels) && (len > 0); 681 for (chan = 1; (chan < mci->csrows[row].nr_channels) && (len > 0);
682 chan++) { 682 chan++) {
683 chars = snprintf(pos, len + 1, ":%s", 683 chars = snprintf(pos, len + 1, ":%s",
684 mci->csrows[row].channels[chan].label); 684 mci->csrows[row].channels[chan].label);
685 len -= chars; 685 len -= chars;
@@ -688,16 +688,16 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
688 688
689 if (edac_mc_get_log_ue()) 689 if (edac_mc_get_log_ue())
690 edac_mc_printk(mci, KERN_EMERG, 690 edac_mc_printk(mci, KERN_EMERG,
691 "UE page 0x%lx, offset 0x%lx, grain %d, row %d, " 691 "UE page 0x%lx, offset 0x%lx, grain %d, row %d, "
692 "labels \"%s\": %s\n", page_frame_number, 692 "labels \"%s\": %s\n", page_frame_number,
693 offset_in_page, mci->csrows[row].grain, row, 693 offset_in_page, mci->csrows[row].grain, row,
694 labels, msg); 694 labels, msg);
695 695
696 if (edac_mc_get_panic_on_ue()) 696 if (edac_mc_get_panic_on_ue())
697 panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, " 697 panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, "
698 "row %d, labels \"%s\": %s\n", mci->mc_idx, 698 "row %d, labels \"%s\": %s\n", mci->mc_idx,
699 page_frame_number, offset_in_page, 699 page_frame_number, offset_in_page,
700 mci->csrows[row].grain, row, labels, msg); 700 mci->csrows[row].grain, row, labels, msg);
701 701
702 mci->ue_count++; 702 mci->ue_count++;
703 mci->csrows[row].ue_count++; 703 mci->csrows[row].ue_count++;
@@ -712,7 +712,7 @@ void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg)
712 712
713 if (edac_mc_get_log_ue()) 713 if (edac_mc_get_log_ue())
714 edac_mc_printk(mci, KERN_WARNING, 714 edac_mc_printk(mci, KERN_WARNING,
715 "UE - no information available: %s\n", msg); 715 "UE - no information available: %s\n", msg);
716 mci->ue_noinfo_count++; 716 mci->ue_noinfo_count++;
717 mci->ue_count++; 717 mci->ue_count++;
718} 718}
@@ -724,9 +724,9 @@ EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info);
724 * called to process UE events 724 * called to process UE events
725 */ 725 */
726void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci, 726void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
727 unsigned int csrow, 727 unsigned int csrow,
728 unsigned int channela, 728 unsigned int channela,
729 unsigned int channelb, char *msg) 729 unsigned int channelb, char *msg)
730{ 730{
731 int len = EDAC_MC_LABEL_LEN * 4; 731 int len = EDAC_MC_LABEL_LEN * 4;
732 char labels[len + 1]; 732 char labels[len + 1];
@@ -736,8 +736,8 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
736 if (csrow >= mci->nr_csrows) { 736 if (csrow >= mci->nr_csrows) {
737 /* something is wrong */ 737 /* something is wrong */
738 edac_mc_printk(mci, KERN_ERR, 738 edac_mc_printk(mci, KERN_ERR,
739 "INTERNAL ERROR: row out of range (%d >= %d)\n", 739 "INTERNAL ERROR: row out of range (%d >= %d)\n",
740 csrow, mci->nr_csrows); 740 csrow, mci->nr_csrows);
741 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); 741 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR");
742 return; 742 return;
743 } 743 }
@@ -745,9 +745,9 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
745 if (channela >= mci->csrows[csrow].nr_channels) { 745 if (channela >= mci->csrows[csrow].nr_channels) {
746 /* something is wrong */ 746 /* something is wrong */
747 edac_mc_printk(mci, KERN_ERR, 747 edac_mc_printk(mci, KERN_ERR,
748 "INTERNAL ERROR: channel-a out of range " 748 "INTERNAL ERROR: channel-a out of range "
749 "(%d >= %d)\n", 749 "(%d >= %d)\n",
750 channela, mci->csrows[csrow].nr_channels); 750 channela, mci->csrows[csrow].nr_channels);
751 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); 751 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR");
752 return; 752 return;
753 } 753 }
@@ -755,9 +755,9 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
755 if (channelb >= mci->csrows[csrow].nr_channels) { 755 if (channelb >= mci->csrows[csrow].nr_channels) {
756 /* something is wrong */ 756 /* something is wrong */
757 edac_mc_printk(mci, KERN_ERR, 757 edac_mc_printk(mci, KERN_ERR,
758 "INTERNAL ERROR: channel-b out of range " 758 "INTERNAL ERROR: channel-b out of range "
759 "(%d >= %d)\n", 759 "(%d >= %d)\n",
760 channelb, mci->csrows[csrow].nr_channels); 760 channelb, mci->csrows[csrow].nr_channels);
761 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); 761 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR");
762 return; 762 return;
763 } 763 }
@@ -775,14 +775,14 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
775 775
776 if (edac_mc_get_log_ue()) 776 if (edac_mc_get_log_ue())
777 edac_mc_printk(mci, KERN_EMERG, 777 edac_mc_printk(mci, KERN_EMERG,
778 "UE row %d, channel-a= %d channel-b= %d " 778 "UE row %d, channel-a= %d channel-b= %d "
779 "labels \"%s\": %s\n", csrow, channela, channelb, 779 "labels \"%s\": %s\n", csrow, channela, channelb,
780 labels, msg); 780 labels, msg);
781 781
782 if (edac_mc_get_panic_on_ue()) 782 if (edac_mc_get_panic_on_ue())
783 panic("UE row %d, channel-a= %d channel-b= %d " 783 panic("UE row %d, channel-a= %d channel-b= %d "
784 "labels \"%s\": %s\n", csrow, channela, 784 "labels \"%s\": %s\n", csrow, channela,
785 channelb, labels, msg); 785 channelb, labels, msg);
786} 786}
787 787
788EXPORT_SYMBOL(edac_mc_handle_fbd_ue); 788EXPORT_SYMBOL(edac_mc_handle_fbd_ue);
@@ -792,23 +792,23 @@ EXPORT_SYMBOL(edac_mc_handle_fbd_ue);
792 * called to process CE events 792 * called to process CE events
793 */ 793 */
794void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci, 794void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
795 unsigned int csrow, unsigned int channel, char *msg) 795 unsigned int csrow, unsigned int channel, char *msg)
796{ 796{
797 797
798 /* Ensure boundary values */ 798 /* Ensure boundary values */
799 if (csrow >= mci->nr_csrows) { 799 if (csrow >= mci->nr_csrows) {
800 /* something is wrong */ 800 /* something is wrong */
801 edac_mc_printk(mci, KERN_ERR, 801 edac_mc_printk(mci, KERN_ERR,
802 "INTERNAL ERROR: row out of range (%d >= %d)\n", 802 "INTERNAL ERROR: row out of range (%d >= %d)\n",
803 csrow, mci->nr_csrows); 803 csrow, mci->nr_csrows);
804 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); 804 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
805 return; 805 return;
806 } 806 }
807 if (channel >= mci->csrows[csrow].nr_channels) { 807 if (channel >= mci->csrows[csrow].nr_channels) {
808 /* something is wrong */ 808 /* something is wrong */
809 edac_mc_printk(mci, KERN_ERR, 809 edac_mc_printk(mci, KERN_ERR,
810 "INTERNAL ERROR: channel out of range (%d >= %d)\n", 810 "INTERNAL ERROR: channel out of range (%d >= %d)\n",
811 channel, mci->csrows[csrow].nr_channels); 811 channel, mci->csrows[csrow].nr_channels);
812 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); 812 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
813 return; 813 return;
814 } 814 }
@@ -816,9 +816,9 @@ void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
816 if (edac_mc_get_log_ce()) 816 if (edac_mc_get_log_ce())
817 /* FIXME - put in DIMM location */ 817 /* FIXME - put in DIMM location */
818 edac_mc_printk(mci, KERN_WARNING, 818 edac_mc_printk(mci, KERN_WARNING,
819 "CE row %d, channel %d, label \"%s\": %s\n", 819 "CE row %d, channel %d, label \"%s\": %s\n",
820 csrow, channel, 820 csrow, channel,
821 mci->csrows[csrow].channels[channel].label, msg); 821 mci->csrows[csrow].channels[channel].label, msg);
822 822
823 mci->ce_count++; 823 mci->ce_count++;
824 mci->csrows[csrow].ce_count++; 824 mci->csrows[csrow].ce_count++;
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 029ce8979a71..bbd845885d4f 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -183,16 +183,16 @@ static struct memctrl_dev_attribute attr_##_name = { \
183 183
184/* csrow<id> control files */ 184/* csrow<id> control files */
185MEMCTRL_ATTR(edac_mc_panic_on_ue, 185MEMCTRL_ATTR(edac_mc_panic_on_ue,
186 S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); 186 S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
187 187
188MEMCTRL_ATTR(edac_mc_log_ue, 188MEMCTRL_ATTR(edac_mc_log_ue,
189 S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); 189 S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
190 190
191MEMCTRL_ATTR(edac_mc_log_ce, 191MEMCTRL_ATTR(edac_mc_log_ce,
192 S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); 192 S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
193 193
194MEMCTRL_ATTR(edac_mc_poll_msec, 194MEMCTRL_ATTR(edac_mc_poll_msec,
195 S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); 195 S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
196 196
197/* Base Attributes of the memory ECC object */ 197/* Base Attributes of the memory ECC object */
198static struct memctrl_dev_attribute *memctrl_attr[] = { 198static struct memctrl_dev_attribute *memctrl_attr[] = {
@@ -281,44 +281,44 @@ void edac_sysfs_memctrl_teardown(void)
281 281
282/* Set of more default csrow<id> attribute show/store functions */ 282/* Set of more default csrow<id> attribute show/store functions */
283static ssize_t csrow_ue_count_show(struct csrow_info *csrow, char *data, 283static ssize_t csrow_ue_count_show(struct csrow_info *csrow, char *data,
284 int private) 284 int private)
285{ 285{
286 return sprintf(data, "%u\n", csrow->ue_count); 286 return sprintf(data, "%u\n", csrow->ue_count);
287} 287}
288 288
289static ssize_t csrow_ce_count_show(struct csrow_info *csrow, char *data, 289static ssize_t csrow_ce_count_show(struct csrow_info *csrow, char *data,
290 int private) 290 int private)
291{ 291{
292 return sprintf(data, "%u\n", csrow->ce_count); 292 return sprintf(data, "%u\n", csrow->ce_count);
293} 293}
294 294
295static ssize_t csrow_size_show(struct csrow_info *csrow, char *data, 295static ssize_t csrow_size_show(struct csrow_info *csrow, char *data,
296 int private) 296 int private)
297{ 297{
298 return sprintf(data, "%u\n", PAGES_TO_MiB(csrow->nr_pages)); 298 return sprintf(data, "%u\n", PAGES_TO_MiB(csrow->nr_pages));
299} 299}
300 300
301static ssize_t csrow_mem_type_show(struct csrow_info *csrow, char *data, 301static ssize_t csrow_mem_type_show(struct csrow_info *csrow, char *data,
302 int private) 302 int private)
303{ 303{
304 return sprintf(data, "%s\n", mem_types[csrow->mtype]); 304 return sprintf(data, "%s\n", mem_types[csrow->mtype]);
305} 305}
306 306
307static ssize_t csrow_dev_type_show(struct csrow_info *csrow, char *data, 307static ssize_t csrow_dev_type_show(struct csrow_info *csrow, char *data,
308 int private) 308 int private)
309{ 309{
310 return sprintf(data, "%s\n", dev_types[csrow->dtype]); 310 return sprintf(data, "%s\n", dev_types[csrow->dtype]);
311} 311}
312 312
313static ssize_t csrow_edac_mode_show(struct csrow_info *csrow, char *data, 313static ssize_t csrow_edac_mode_show(struct csrow_info *csrow, char *data,
314 int private) 314 int private)
315{ 315{
316 return sprintf(data, "%s\n", edac_caps[csrow->edac_mode]); 316 return sprintf(data, "%s\n", edac_caps[csrow->edac_mode]);
317} 317}
318 318
319/* show/store functions for DIMM Label attributes */ 319/* show/store functions for DIMM Label attributes */
320static ssize_t channel_dimm_label_show(struct csrow_info *csrow, 320static ssize_t channel_dimm_label_show(struct csrow_info *csrow,
321 char *data, int channel) 321 char *data, int channel)
322{ 322{
323 return snprintf(data, EDAC_MC_LABEL_LEN, "%s", 323 return snprintf(data, EDAC_MC_LABEL_LEN, "%s",
324 csrow->channels[channel].label); 324 csrow->channels[channel].label);
@@ -339,7 +339,7 @@ static ssize_t channel_dimm_label_store(struct csrow_info *csrow,
339 339
340/* show function for dynamic chX_ce_count attribute */ 340/* show function for dynamic chX_ce_count attribute */
341static ssize_t channel_ce_count_show(struct csrow_info *csrow, 341static ssize_t channel_ce_count_show(struct csrow_info *csrow,
342 char *data, int channel) 342 char *data, int channel)
343{ 343{
344 return sprintf(data, "%u\n", csrow->channels[channel].ce_count); 344 return sprintf(data, "%u\n", csrow->channels[channel].ce_count);
345} 345}
@@ -357,27 +357,27 @@ struct csrowdev_attribute {
357 357
358/* Set of show/store higher level functions for default csrow attributes */ 358/* Set of show/store higher level functions for default csrow attributes */
359static ssize_t csrowdev_show(struct kobject *kobj, 359static ssize_t csrowdev_show(struct kobject *kobj,
360 struct attribute *attr, char *buffer) 360 struct attribute *attr, char *buffer)
361{ 361{
362 struct csrow_info *csrow = to_csrow(kobj); 362 struct csrow_info *csrow = to_csrow(kobj);
363 struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr); 363 struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr);
364 364
365 if (csrowdev_attr->show) 365 if (csrowdev_attr->show)
366 return csrowdev_attr->show(csrow, 366 return csrowdev_attr->show(csrow,
367 buffer, csrowdev_attr->private); 367 buffer, csrowdev_attr->private);
368 return -EIO; 368 return -EIO;
369} 369}
370 370
371static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr, 371static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr,
372 const char *buffer, size_t count) 372 const char *buffer, size_t count)
373{ 373{
374 struct csrow_info *csrow = to_csrow(kobj); 374 struct csrow_info *csrow = to_csrow(kobj);
375 struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr); 375 struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr);
376 376
377 if (csrowdev_attr->store) 377 if (csrowdev_attr->store)
378 return csrowdev_attr->store(csrow, 378 return csrowdev_attr->store(csrow,
379 buffer, 379 buffer,
380 count, csrowdev_attr->private); 380 count, csrowdev_attr->private);
381 return -EIO; 381 return -EIO;
382} 382}
383 383
@@ -415,17 +415,17 @@ static struct csrowdev_attribute *default_csrow_attr[] = {
415 415
416/* possible dynamic channel DIMM Label attribute files */ 416/* possible dynamic channel DIMM Label attribute files */
417CSROWDEV_ATTR(ch0_dimm_label, S_IRUGO | S_IWUSR, 417CSROWDEV_ATTR(ch0_dimm_label, S_IRUGO | S_IWUSR,
418 channel_dimm_label_show, channel_dimm_label_store, 0); 418 channel_dimm_label_show, channel_dimm_label_store, 0);
419CSROWDEV_ATTR(ch1_dimm_label, S_IRUGO | S_IWUSR, 419CSROWDEV_ATTR(ch1_dimm_label, S_IRUGO | S_IWUSR,
420 channel_dimm_label_show, channel_dimm_label_store, 1); 420 channel_dimm_label_show, channel_dimm_label_store, 1);
421CSROWDEV_ATTR(ch2_dimm_label, S_IRUGO | S_IWUSR, 421CSROWDEV_ATTR(ch2_dimm_label, S_IRUGO | S_IWUSR,
422 channel_dimm_label_show, channel_dimm_label_store, 2); 422 channel_dimm_label_show, channel_dimm_label_store, 2);
423CSROWDEV_ATTR(ch3_dimm_label, S_IRUGO | S_IWUSR, 423CSROWDEV_ATTR(ch3_dimm_label, S_IRUGO | S_IWUSR,
424 channel_dimm_label_show, channel_dimm_label_store, 3); 424 channel_dimm_label_show, channel_dimm_label_store, 3);
425CSROWDEV_ATTR(ch4_dimm_label, S_IRUGO | S_IWUSR, 425CSROWDEV_ATTR(ch4_dimm_label, S_IRUGO | S_IWUSR,
426 channel_dimm_label_show, channel_dimm_label_store, 4); 426 channel_dimm_label_show, channel_dimm_label_store, 4);
427CSROWDEV_ATTR(ch5_dimm_label, S_IRUGO | S_IWUSR, 427CSROWDEV_ATTR(ch5_dimm_label, S_IRUGO | S_IWUSR,
428 channel_dimm_label_show, channel_dimm_label_store, 5); 428 channel_dimm_label_show, channel_dimm_label_store, 5);
429 429
430/* Total possible dynamic DIMM Label attribute file table */ 430/* Total possible dynamic DIMM Label attribute file table */
431static struct csrowdev_attribute *dynamic_csrow_dimm_attr[] = { 431static struct csrowdev_attribute *dynamic_csrow_dimm_attr[] = {
@@ -501,7 +501,7 @@ static struct kobj_type ktype_csrow = {
501 501
502/* Create a CSROW object under specifed edac_mc_device */ 502/* Create a CSROW object under specifed edac_mc_device */
503static int edac_create_csrow_object(struct kobject *edac_mci_kobj, 503static int edac_create_csrow_object(struct kobject *edac_mci_kobj,
504 struct csrow_info *csrow, int index) 504 struct csrow_info *csrow, int index)
505{ 505{
506 int err = 0; 506 int err = 0;
507 int chan; 507 int chan;
@@ -531,7 +531,7 @@ static int edac_create_csrow_object(struct kobject *edac_mci_kobj,
531 } 531 }
532 } 532 }
533 533
534 error_exit: 534error_exit:
535 return err; 535 return err;
536} 536}
537 537
@@ -563,7 +563,7 @@ static ssize_t mci_reset_counters_store(struct mem_ctl_info *mci,
563 563
564/* memory scrubbing */ 564/* memory scrubbing */
565static ssize_t mci_sdram_scrub_rate_store(struct mem_ctl_info *mci, 565static ssize_t mci_sdram_scrub_rate_store(struct mem_ctl_info *mci,
566 const char *data, size_t count) 566 const char *data, size_t count)
567{ 567{
568 u32 bandwidth = -1; 568 u32 bandwidth = -1;
569 569
@@ -573,18 +573,18 @@ static ssize_t mci_sdram_scrub_rate_store(struct mem_ctl_info *mci,
573 573
574 if (!(*mci->set_sdram_scrub_rate) (mci, &bandwidth)) { 574 if (!(*mci->set_sdram_scrub_rate) (mci, &bandwidth)) {
575 edac_printk(KERN_DEBUG, EDAC_MC, 575 edac_printk(KERN_DEBUG, EDAC_MC,
576 "Scrub rate set successfully, applied: %d\n", 576 "Scrub rate set successfully, applied: %d\n",
577 bandwidth); 577 bandwidth);
578 } else { 578 } else {
579 /* FIXME: error codes maybe? */ 579 /* FIXME: error codes maybe? */
580 edac_printk(KERN_DEBUG, EDAC_MC, 580 edac_printk(KERN_DEBUG, EDAC_MC,
581 "Scrub rate set FAILED, could not apply: %d\n", 581 "Scrub rate set FAILED, could not apply: %d\n",
582 bandwidth); 582 bandwidth);
583 } 583 }
584 } else { 584 } else {
585 /* FIXME: produce "not implemented" ERROR for user-side. */ 585 /* FIXME: produce "not implemented" ERROR for user-side. */
586 edac_printk(KERN_WARNING, EDAC_MC, 586 edac_printk(KERN_WARNING, EDAC_MC,
587 "Memory scrubbing 'set'control is not implemented!\n"); 587 "Memory scrubbing 'set'control is not implemented!\n");
588 } 588 }
589 return count; 589 return count;
590} 590}
@@ -596,18 +596,18 @@ static ssize_t mci_sdram_scrub_rate_show(struct mem_ctl_info *mci, char *data)
596 if (mci->get_sdram_scrub_rate) { 596 if (mci->get_sdram_scrub_rate) {
597 if (!(*mci->get_sdram_scrub_rate) (mci, &bandwidth)) { 597 if (!(*mci->get_sdram_scrub_rate) (mci, &bandwidth)) {
598 edac_printk(KERN_DEBUG, EDAC_MC, 598 edac_printk(KERN_DEBUG, EDAC_MC,
599 "Scrub rate successfully, fetched: %d\n", 599 "Scrub rate successfully, fetched: %d\n",
600 bandwidth); 600 bandwidth);
601 } else { 601 } else {
602 /* FIXME: error codes maybe? */ 602 /* FIXME: error codes maybe? */
603 edac_printk(KERN_DEBUG, EDAC_MC, 603 edac_printk(KERN_DEBUG, EDAC_MC,
604 "Scrub rate fetch FAILED, got: %d\n", 604 "Scrub rate fetch FAILED, got: %d\n",
605 bandwidth); 605 bandwidth);
606 } 606 }
607 } else { 607 } else {
608 /* FIXME: produce "not implemented" ERROR for user-side. */ 608 /* FIXME: produce "not implemented" ERROR for user-side. */
609 edac_printk(KERN_WARNING, EDAC_MC, 609 edac_printk(KERN_WARNING, EDAC_MC,
610 "Memory scrubbing 'get' control is not implemented\n"); 610 "Memory scrubbing 'get' control is not implemented\n");
611 } 611 }
612 return sprintf(data, "%d\n", bandwidth); 612 return sprintf(data, "%d\n", bandwidth);
613} 613}
@@ -648,7 +648,7 @@ static ssize_t mci_size_mb_show(struct mem_ctl_info *mci, char *data)
648 int total_pages, csrow_idx; 648 int total_pages, csrow_idx;
649 649
650 for (total_pages = csrow_idx = 0; csrow_idx < mci->nr_csrows; 650 for (total_pages = csrow_idx = 0; csrow_idx < mci->nr_csrows;
651 csrow_idx++) { 651 csrow_idx++) {
652 struct csrow_info *csrow = &mci->csrows[csrow_idx]; 652 struct csrow_info *csrow = &mci->csrows[csrow_idx];
653 653
654 if (!csrow->nr_pages) 654 if (!csrow->nr_pages)
@@ -665,7 +665,7 @@ static ssize_t mci_size_mb_show(struct mem_ctl_info *mci, char *data)
665 665
666/* MCI show/store functions for top most object */ 666/* MCI show/store functions for top most object */
667static ssize_t mcidev_show(struct kobject *kobj, struct attribute *attr, 667static ssize_t mcidev_show(struct kobject *kobj, struct attribute *attr,
668 char *buffer) 668 char *buffer)
669{ 669{
670 struct mem_ctl_info *mem_ctl_info = to_mci(kobj); 670 struct mem_ctl_info *mem_ctl_info = to_mci(kobj);
671 struct mcidev_sysfs_attribute *mcidev_attr = to_mcidev_attr(attr); 671 struct mcidev_sysfs_attribute *mcidev_attr = to_mcidev_attr(attr);
@@ -677,7 +677,7 @@ static ssize_t mcidev_show(struct kobject *kobj, struct attribute *attr,
677} 677}
678 678
679static ssize_t mcidev_store(struct kobject *kobj, struct attribute *attr, 679static ssize_t mcidev_store(struct kobject *kobj, struct attribute *attr,
680 const char *buffer, size_t count) 680 const char *buffer, size_t count)
681{ 681{
682 struct mem_ctl_info *mem_ctl_info = to_mci(kobj); 682 struct mem_ctl_info *mem_ctl_info = to_mci(kobj);
683 struct mcidev_sysfs_attribute *mcidev_attr = to_mcidev_attr(attr); 683 struct mcidev_sysfs_attribute *mcidev_attr = to_mcidev_attr(attr);
@@ -714,7 +714,7 @@ MCIDEV_ATTR(ce_count, S_IRUGO, mci_ce_count_show, NULL);
714 714
715/* memory scrubber attribute file */ 715/* memory scrubber attribute file */
716MCIDEV_ATTR(sdram_scrub_rate, S_IRUGO | S_IWUSR, mci_sdram_scrub_rate_show, 716MCIDEV_ATTR(sdram_scrub_rate, S_IRUGO | S_IWUSR, mci_sdram_scrub_rate_show,
717 mci_sdram_scrub_rate_store); 717 mci_sdram_scrub_rate_store);
718 718
719static struct mcidev_sysfs_attribute *mci_attr[] = { 719static struct mcidev_sysfs_attribute *mci_attr[] = {
720 &mci_attr_reset_counters, 720 &mci_attr_reset_counters,
@@ -841,7 +841,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
841 return 0; 841 return 0;
842 842
843 /* CSROW error: backout what has already been registered, */ 843 /* CSROW error: backout what has already been registered, */
844 fail1: 844fail1:
845 for (i--; i >= 0; i--) { 845 for (i--; i >= 0; i--) {
846 if (csrow->nr_pages > 0) { 846 if (csrow->nr_pages > 0) {
847 init_completion(&csrow->kobj_complete); 847 init_completion(&csrow->kobj_complete);
@@ -850,7 +850,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
850 } 850 }
851 } 851 }
852 852
853 fail0: 853fail0:
854 init_completion(&mci->kobj_complete); 854 init_completion(&mci->kobj_complete);
855 kobject_unregister(edac_mci_kobj); 855 kobject_unregister(edac_mci_kobj);
856 wait_for_completion(&mci->kobj_complete); 856 wait_for_completion(&mci->kobj_complete);
diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c
index 687d2ef2bbed..d43f9ddc5c49 100644
--- a/drivers/edac/edac_module.c
+++ b/drivers/edac/edac_module.c
@@ -157,7 +157,7 @@ static int __init edac_init(void)
157 */ 157 */
158 if (edac_register_sysfs_edac_name()) { 158 if (edac_register_sysfs_edac_name()) {
159 edac_printk(KERN_ERR, EDAC_MC, 159 edac_printk(KERN_ERR, EDAC_MC,
160 "Error initializing 'edac' kobject\n"); 160 "Error initializing 'edac' kobject\n");
161 err = -ENODEV; 161 err = -ENODEV;
162 goto error; 162 goto error;
163 } 163 }
@@ -166,7 +166,7 @@ static int __init edac_init(void)
166 */ 166 */
167 if (edac_sysfs_memctrl_setup()) { 167 if (edac_sysfs_memctrl_setup()) {
168 edac_printk(KERN_ERR, EDAC_MC, 168 edac_printk(KERN_ERR, EDAC_MC,
169 "Error initializing sysfs code\n"); 169 "Error initializing sysfs code\n");
170 err = -ENODEV; 170 err = -ENODEV;
171 goto error_sysfs; 171 goto error_sysfs;
172 } 172 }
@@ -181,11 +181,11 @@ static int __init edac_init(void)
181 return 0; 181 return 0;
182 182
183 /* Error teardown stack */ 183 /* Error teardown stack */
184 error_mem: 184error_mem:
185 edac_sysfs_memctrl_teardown(); 185 edac_sysfs_memctrl_teardown();
186 error_sysfs: 186error_sysfs:
187 edac_unregister_sysfs_edac_name(); 187 edac_unregister_sysfs_edac_name();
188 error: 188error:
189 return err; 189 return err;
190} 190}
191 191
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index ac16b434a3c5..f4f718c764db 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -47,7 +47,7 @@ static inline void edac_unlock_pci_list(void)
47 * edac_pci it is going to control/register with the EDAC CORE. 47 * edac_pci it is going to control/register with the EDAC CORE.
48 */ 48 */
49struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, 49struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt,
50 const char *edac_pci_name) 50 const char *edac_pci_name)
51{ 51{
52 struct edac_pci_ctl_info *pci; 52 struct edac_pci_ctl_info *pci;
53 void *pvt; 53 void *pvt;
@@ -140,18 +140,18 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci)
140 list_add_tail_rcu(&pci->link, insert_before); 140 list_add_tail_rcu(&pci->link, insert_before);
141 return 0; 141 return 0;
142 142
143 fail0: 143fail0:
144 edac_printk(KERN_WARNING, EDAC_PCI, 144 edac_printk(KERN_WARNING, EDAC_PCI,
145 "%s (%s) %s %s already assigned %d\n", 145 "%s (%s) %s %s already assigned %d\n",
146 rover->dev->bus_id, dev_name(rover), 146 rover->dev->bus_id, dev_name(rover),
147 rover->mod_name, rover->ctl_name, rover->pci_idx); 147 rover->mod_name, rover->ctl_name, rover->pci_idx);
148 return 1; 148 return 1;
149 149
150 fail1: 150fail1:
151 edac_printk(KERN_WARNING, EDAC_PCI, 151 edac_printk(KERN_WARNING, EDAC_PCI,
152 "but in low-level driver: attempt to assign\n" 152 "but in low-level driver: attempt to assign\n"
153 "\tduplicate pci_idx %d in %s()\n", rover->pci_idx, 153 "\tduplicate pci_idx %d in %s()\n", rover->pci_idx,
154 __func__); 154 __func__);
155 return 1; 155 return 1;
156} 156}
157 157
@@ -222,14 +222,14 @@ static void edac_pci_workq_function(struct work_struct *work_req)
222 edac_lock_pci_list(); 222 edac_lock_pci_list();
223 223
224 if ((pci->op_state == OP_RUNNING_POLL) && 224 if ((pci->op_state == OP_RUNNING_POLL) &&
225 (pci->edac_check != NULL) && (edac_pci_get_check_errors())) 225 (pci->edac_check != NULL) && (edac_pci_get_check_errors()))
226 pci->edac_check(pci); 226 pci->edac_check(pci);
227 227
228 edac_unlock_pci_list(); 228 edac_unlock_pci_list();
229 229
230 /* Reschedule */ 230 /* Reschedule */
231 queue_delayed_work(edac_workqueue, &pci->work, 231 queue_delayed_work(edac_workqueue, &pci->work,
232 msecs_to_jiffies(edac_pci_get_poll_msec())); 232 msecs_to_jiffies(edac_pci_get_poll_msec()));
233} 233}
234 234
235/* 235/*
@@ -244,7 +244,7 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci,
244 244
245 INIT_DELAYED_WORK(&pci->work, edac_pci_workq_function); 245 INIT_DELAYED_WORK(&pci->work, edac_pci_workq_function);
246 queue_delayed_work(edac_workqueue, &pci->work, 246 queue_delayed_work(edac_workqueue, &pci->work,
247 msecs_to_jiffies(edac_pci_get_poll_msec())); 247 msecs_to_jiffies(edac_pci_get_poll_msec()));
248} 248}
249 249
250/* 250/*
@@ -326,9 +326,9 @@ int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx)
326 edac_unlock_pci_list(); 326 edac_unlock_pci_list();
327 return 0; 327 return 0;
328 328
329 fail1: 329fail1:
330 del_edac_pci_from_global_list(pci); 330 del_edac_pci_from_global_list(pci);
331 fail0: 331fail0:
332 edac_unlock_pci_list(); 332 edac_unlock_pci_list();
333 return 1; 333 return 1;
334} 334}
@@ -372,8 +372,8 @@ struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev)
372 edac_unlock_pci_list(); 372 edac_unlock_pci_list();
373 373
374 edac_printk(KERN_INFO, EDAC_PCI, 374 edac_printk(KERN_INFO, EDAC_PCI,
375 "Removed device %d for %s %s: DEV %s\n", 375 "Removed device %d for %s %s: DEV %s\n",
376 pci->pci_idx, pci->mod_name, pci->ctl_name, dev_name(pci)); 376 pci->pci_idx, pci->mod_name, pci->ctl_name, dev_name(pci));
377 377
378 return pci; 378 return pci;
379} 379}
@@ -393,7 +393,7 @@ struct edac_pci_gen_data {
393}; 393};
394 394
395struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev, 395struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev,
396 const char *mod_name) 396 const char *mod_name)
397{ 397{
398 struct edac_pci_ctl_info *pci; 398 struct edac_pci_ctl_info *pci;
399 struct edac_pci_gen_data *pdata; 399 struct edac_pci_gen_data *pdata;
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index f471659a1c35..804833ce0fef 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -61,7 +61,7 @@ static ssize_t instance_pe_count_show(struct edac_pci_ctl_info *pci, char *data)
61} 61}
62 62
63static ssize_t instance_npe_count_show(struct edac_pci_ctl_info *pci, 63static ssize_t instance_npe_count_show(struct edac_pci_ctl_info *pci,
64 char *data) 64 char *data)
65{ 65{
66 return sprintf(data, "%u\n", atomic_read(&pci->counters.npe_count)); 66 return sprintf(data, "%u\n", atomic_read(&pci->counters.npe_count));
67} 67}
@@ -89,7 +89,7 @@ struct instance_attribute {
89 89
90/* Function to 'show' fields from the edac_pci 'instance' structure */ 90/* Function to 'show' fields from the edac_pci 'instance' structure */
91static ssize_t edac_pci_instance_show(struct kobject *kobj, 91static ssize_t edac_pci_instance_show(struct kobject *kobj,
92 struct attribute *attr, char *buffer) 92 struct attribute *attr, char *buffer)
93{ 93{
94 struct edac_pci_ctl_info *pci = to_instance(kobj); 94 struct edac_pci_ctl_info *pci = to_instance(kobj);
95 struct instance_attribute *instance_attr = to_instance_attr(attr); 95 struct instance_attribute *instance_attr = to_instance_attr(attr);
@@ -101,8 +101,8 @@ static ssize_t edac_pci_instance_show(struct kobject *kobj,
101 101
102/* Function to 'store' fields into the edac_pci 'instance' structure */ 102/* Function to 'store' fields into the edac_pci 'instance' structure */
103static ssize_t edac_pci_instance_store(struct kobject *kobj, 103static ssize_t edac_pci_instance_store(struct kobject *kobj,
104 struct attribute *attr, 104 struct attribute *attr,
105 const char *buffer, size_t count) 105 const char *buffer, size_t count)
106{ 106{
107 struct edac_pci_ctl_info *pci = to_instance(kobj); 107 struct edac_pci_ctl_info *pci = to_instance(kobj);
108 struct instance_attribute *instance_attr = to_instance_attr(attr); 108 struct instance_attribute *instance_attr = to_instance_attr(attr);
@@ -212,8 +212,8 @@ static ssize_t edac_pci_dev_show(struct kobject *kobj, struct attribute *attr,
212} 212}
213 213
214static ssize_t edac_pci_dev_store(struct kobject *kobj, 214static ssize_t edac_pci_dev_store(struct kobject *kobj,
215 struct attribute *attr, const char *buffer, 215 struct attribute *attr, const char *buffer,
216 size_t count) 216 size_t count)
217{ 217{
218 struct edac_pci_dev_attribute *edac_pci_dev; 218 struct edac_pci_dev_attribute *edac_pci_dev;
219 edac_pci_dev = (struct edac_pci_dev_attribute *)attr; 219 edac_pci_dev = (struct edac_pci_dev_attribute *)attr;
@@ -246,13 +246,13 @@ static struct edac_pci_dev_attribute edac_pci_attr_##_name = { \
246 246
247/* PCI Parity control files */ 247/* PCI Parity control files */
248EDAC_PCI_ATTR(check_pci_errors, S_IRUGO | S_IWUSR, edac_pci_int_show, 248EDAC_PCI_ATTR(check_pci_errors, S_IRUGO | S_IWUSR, edac_pci_int_show,
249 edac_pci_int_store); 249 edac_pci_int_store);
250EDAC_PCI_ATTR(edac_pci_log_pe, S_IRUGO | S_IWUSR, edac_pci_int_show, 250EDAC_PCI_ATTR(edac_pci_log_pe, S_IRUGO | S_IWUSR, edac_pci_int_show,
251 edac_pci_int_store); 251 edac_pci_int_store);
252EDAC_PCI_ATTR(edac_pci_log_npe, S_IRUGO | S_IWUSR, edac_pci_int_show, 252EDAC_PCI_ATTR(edac_pci_log_npe, S_IRUGO | S_IWUSR, edac_pci_int_show,
253 edac_pci_int_store); 253 edac_pci_int_store);
254EDAC_PCI_ATTR(edac_pci_panic_on_pe, S_IRUGO | S_IWUSR, edac_pci_int_show, 254EDAC_PCI_ATTR(edac_pci_panic_on_pe, S_IRUGO | S_IWUSR, edac_pci_int_show,
255 edac_pci_int_store); 255 edac_pci_int_store);
256EDAC_PCI_ATTR(pci_parity_count, S_IRUGO, edac_pci_int_show, NULL); 256EDAC_PCI_ATTR(pci_parity_count, S_IRUGO, edac_pci_int_show, NULL);
257EDAC_PCI_ATTR(pci_nonparity_count, S_IRUGO, edac_pci_int_show, NULL); 257EDAC_PCI_ATTR(pci_nonparity_count, S_IRUGO, edac_pci_int_show, NULL);
258 258
@@ -405,7 +405,7 @@ static u16 get_pci_parity_status(struct pci_dev *dev, int secondary)
405 } 405 }
406 406
407 status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR | 407 status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR |
408 PCI_STATUS_PARITY; 408 PCI_STATUS_PARITY;
409 409
410 if (status) 410 if (status)
411 /* reset only the bits we are interested in */ 411 /* reset only the bits we are interested in */
@@ -449,23 +449,23 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
449 if (status) { 449 if (status) {
450 if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) { 450 if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) {
451 edac_printk(KERN_CRIT, EDAC_PCI, 451 edac_printk(KERN_CRIT, EDAC_PCI,
452 "Signaled System Error on %s\n", 452 "Signaled System Error on %s\n",
453 pci_name(dev)); 453 pci_name(dev));
454 atomic_inc(&pci_nonparity_count); 454 atomic_inc(&pci_nonparity_count);
455 } 455 }
456 456
457 if (status & (PCI_STATUS_PARITY)) { 457 if (status & (PCI_STATUS_PARITY)) {
458 edac_printk(KERN_CRIT, EDAC_PCI, 458 edac_printk(KERN_CRIT, EDAC_PCI,
459 "Master Data Parity Error on %s\n", 459 "Master Data Parity Error on %s\n",
460 pci_name(dev)); 460 pci_name(dev));
461 461
462 atomic_inc(&pci_parity_count); 462 atomic_inc(&pci_parity_count);
463 } 463 }
464 464
465 if (status & (PCI_STATUS_DETECTED_PARITY)) { 465 if (status & (PCI_STATUS_DETECTED_PARITY)) {
466 edac_printk(KERN_CRIT, EDAC_PCI, 466 edac_printk(KERN_CRIT, EDAC_PCI,
467 "Detected Parity Error on %s\n", 467 "Detected Parity Error on %s\n",
468 pci_name(dev)); 468 pci_name(dev));
469 469
470 atomic_inc(&pci_parity_count); 470 atomic_inc(&pci_parity_count);
471 } 471 }
@@ -486,23 +486,23 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
486 if (status) { 486 if (status) {
487 if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) { 487 if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) {
488 edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " 488 edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
489 "Signaled System Error on %s\n", 489 "Signaled System Error on %s\n",
490 pci_name(dev)); 490 pci_name(dev));
491 atomic_inc(&pci_nonparity_count); 491 atomic_inc(&pci_nonparity_count);
492 } 492 }
493 493
494 if (status & (PCI_STATUS_PARITY)) { 494 if (status & (PCI_STATUS_PARITY)) {
495 edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " 495 edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
496 "Master Data Parity Error on " 496 "Master Data Parity Error on "
497 "%s\n", pci_name(dev)); 497 "%s\n", pci_name(dev));
498 498
499 atomic_inc(&pci_parity_count); 499 atomic_inc(&pci_parity_count);
500 } 500 }
501 501
502 if (status & (PCI_STATUS_DETECTED_PARITY)) { 502 if (status & (PCI_STATUS_DETECTED_PARITY)) {
503 edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " 503 edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
504 "Detected Parity Error on %s\n", 504 "Detected Parity Error on %s\n",
505 pci_name(dev)); 505 pci_name(dev));
506 506
507 atomic_inc(&pci_parity_count); 507 atomic_inc(&pci_parity_count);
508 } 508 }
diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c
index fa4c4d48756f..d410bf7c4463 100644
--- a/drivers/edac/i3000_edac.c
+++ b/drivers/edac/i3000_edac.c
@@ -148,7 +148,7 @@ struct i3000_error_info {
148 148
149static const struct i3000_dev_info i3000_devs[] = { 149static const struct i3000_dev_info i3000_devs[] = {
150 [I3000] = { 150 [I3000] = {
151 .ctl_name = "i3000"}, 151 .ctl_name = "i3000"},
152}; 152};
153 153
154static struct pci_dev *mci_pdev = NULL; 154static struct pci_dev *mci_pdev = NULL;
@@ -195,8 +195,8 @@ static void i3000_get_error_info(struct mem_ctl_info *mci,
195} 195}
196 196
197static int i3000_process_error_info(struct mem_ctl_info *mci, 197static int i3000_process_error_info(struct mem_ctl_info *mci,
198 struct i3000_error_info *info, 198 struct i3000_error_info *info,
199 int handle_errors) 199 int handle_errors)
200{ 200{
201 int row, multi_chan; 201 int row, multi_chan;
202 int pfn, offset, channel; 202 int pfn, offset, channel;
@@ -224,7 +224,7 @@ static int i3000_process_error_info(struct mem_ctl_info *mci,
224 edac_mc_handle_ue(mci, pfn, offset, row, "i3000 UE"); 224 edac_mc_handle_ue(mci, pfn, offset, row, "i3000 UE");
225 else 225 else
226 edac_mc_handle_ce(mci, pfn, offset, info->derrsyn, row, 226 edac_mc_handle_ce(mci, pfn, offset, info->derrsyn, row,
227 multi_chan ? channel : 0, "i3000 CE"); 227 multi_chan ? channel : 0, "i3000 CE");
228 228
229 return 1; 229 return 1;
230} 230}
@@ -250,7 +250,8 @@ static int i3000_is_interleaved(const unsigned char *c0dra,
250 */ 250 */
251 for (i = 0; i < I3000_RANKS_PER_CHANNEL / 2; i++) 251 for (i = 0; i < I3000_RANKS_PER_CHANNEL / 2; i++)
252 if (ODD_RANK_ATTRIB(c0dra[i]) != ODD_RANK_ATTRIB(c1dra[i]) || 252 if (ODD_RANK_ATTRIB(c0dra[i]) != ODD_RANK_ATTRIB(c1dra[i]) ||
253 EVEN_RANK_ATTRIB(c0dra[i]) != EVEN_RANK_ATTRIB(c1dra[i])) 253 EVEN_RANK_ATTRIB(c0dra[i]) !=
254 EVEN_RANK_ATTRIB(c1dra[i]))
254 return 0; 255 return 0;
255 256
256 /* If the rank boundaries for the two channels are different 257 /* If the rank boundaries for the two channels are different
@@ -283,7 +284,7 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx)
283 window = ioremap_nocache(mchbar, I3000_MMR_WINDOW_SIZE); 284 window = ioremap_nocache(mchbar, I3000_MMR_WINDOW_SIZE);
284 if (!window) { 285 if (!window) {
285 printk(KERN_ERR "i3000: cannot map mmio space at 0x%lx\n", 286 printk(KERN_ERR "i3000: cannot map mmio space at 0x%lx\n",
286 mchbar); 287 mchbar);
287 return -ENODEV; 288 return -ENODEV;
288 } 289 }
289 290
@@ -398,7 +399,7 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx)
398 399
399/* returns count (>= 0), or negative on error */ 400/* returns count (>= 0), or negative on error */
400static int __devinit i3000_init_one(struct pci_dev *pdev, 401static int __devinit i3000_init_one(struct pci_dev *pdev,
401 const struct pci_device_id *ent) 402 const struct pci_device_id *ent)
402{ 403{
403 int rc; 404 int rc;
404 405
@@ -459,7 +460,7 @@ static int __init i3000_init(void)
459 if (mci_pdev == NULL) { 460 if (mci_pdev == NULL) {
460 i3000_registered = 0; 461 i3000_registered = 0;
461 mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 462 mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
462 PCI_DEVICE_ID_INTEL_3000_HB, NULL); 463 PCI_DEVICE_ID_INTEL_3000_HB, NULL);
463 if (!mci_pdev) { 464 if (!mci_pdev) {
464 debugf0("i3000 pci_get_device fail\n"); 465 debugf0("i3000 pci_get_device fail\n");
465 pci_rc = -ENODEV; 466 pci_rc = -ENODEV;
@@ -476,10 +477,10 @@ static int __init i3000_init(void)
476 477
477 return 0; 478 return 0;
478 479
479 fail1: 480fail1:
480 pci_unregister_driver(&i3000_driver); 481 pci_unregister_driver(&i3000_driver);
481 482
482 fail0: 483fail0:
483 if (mci_pdev) 484 if (mci_pdev)
484 pci_dev_put(mci_pdev); 485 pci_dev_put(mci_pdev);
485 486
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c
index 4b4ec978df2c..efc8853a205b 100644
--- a/drivers/edac/i5000_edac.c
+++ b/drivers/edac/i5000_edac.c
@@ -77,7 +77,7 @@
77#define FERR_FAT_M3ERR 0x00000004 77#define FERR_FAT_M3ERR 0x00000004
78#define FERR_FAT_M2ERR 0x00000002 78#define FERR_FAT_M2ERR 0x00000002
79#define FERR_FAT_M1ERR 0x00000001 79#define FERR_FAT_M1ERR 0x00000001
80#define FERR_FAT_MASK (FERR_FAT_M1ERR | \ 80#define FERR_FAT_MASK (FERR_FAT_M1ERR | \
81 FERR_FAT_M2ERR | \ 81 FERR_FAT_M2ERR | \
82 FERR_FAT_M3ERR) 82 FERR_FAT_M3ERR)
83 83
@@ -119,7 +119,7 @@
119#define FERR_NF_UNCORRECTABLE (FERR_NF_M12ERR | \ 119#define FERR_NF_UNCORRECTABLE (FERR_NF_M12ERR | \
120 FERR_NF_M11ERR | \ 120 FERR_NF_M11ERR | \
121 FERR_NF_M10ERR | \ 121 FERR_NF_M10ERR | \
122 FERR_NF_M8ERR | \ 122 FERR_NF_M8ERR | \
123 FERR_NF_M7ERR | \ 123 FERR_NF_M7ERR | \
124 FERR_NF_M6ERR | \ 124 FERR_NF_M6ERR | \
125 FERR_NF_M5ERR | \ 125 FERR_NF_M5ERR | \
@@ -131,7 +131,7 @@
131#define FERR_NF_DIMM_SPARE (FERR_NF_M27ERR | \ 131#define FERR_NF_DIMM_SPARE (FERR_NF_M27ERR | \
132 FERR_NF_M28ERR) 132 FERR_NF_M28ERR)
133#define FERR_NF_THERMAL (FERR_NF_M26ERR | \ 133#define FERR_NF_THERMAL (FERR_NF_M26ERR | \
134 FERR_NF_M25ERR | \ 134 FERR_NF_M25ERR | \
135 FERR_NF_M24ERR | \ 135 FERR_NF_M24ERR | \
136 FERR_NF_M23ERR) 136 FERR_NF_M23ERR)
137#define FERR_NF_SPD_PROTOCOL (FERR_NF_M22ERR) 137#define FERR_NF_SPD_PROTOCOL (FERR_NF_M22ERR)
@@ -317,9 +317,9 @@ struct i5000_dev_info {
317/* Table of devices attributes supported by this driver */ 317/* Table of devices attributes supported by this driver */
318static const struct i5000_dev_info i5000_devs[] = { 318static const struct i5000_dev_info i5000_devs[] = {
319 [I5000P] = { 319 [I5000P] = {
320 .ctl_name = "I5000", 320 .ctl_name = "I5000",
321 .fsb_mapping_errors = PCI_DEVICE_ID_INTEL_I5000_DEV16, 321 .fsb_mapping_errors = PCI_DEVICE_ID_INTEL_I5000_DEV16,
322 }, 322 },
323}; 323};
324 324
325struct i5000_dimm_info { 325struct i5000_dimm_info {
@@ -411,15 +411,15 @@ static void i5000_get_error_info(struct mem_ctl_info *mci,
411 411
412 /* harvest the various error data we need */ 412 /* harvest the various error data we need */
413 pci_read_config_dword(pvt->branchmap_werrors, 413 pci_read_config_dword(pvt->branchmap_werrors,
414 NERR_FAT_FBD, &info->nerr_fat_fbd); 414 NERR_FAT_FBD, &info->nerr_fat_fbd);
415 pci_read_config_word(pvt->branchmap_werrors, 415 pci_read_config_word(pvt->branchmap_werrors,
416 NRECMEMA, &info->nrecmema); 416 NRECMEMA, &info->nrecmema);
417 pci_read_config_word(pvt->branchmap_werrors, 417 pci_read_config_word(pvt->branchmap_werrors,
418 NRECMEMB, &info->nrecmemb); 418 NRECMEMB, &info->nrecmemb);
419 419
420 /* Clear the error bits, by writing them back */ 420 /* Clear the error bits, by writing them back */
421 pci_write_config_dword(pvt->branchmap_werrors, 421 pci_write_config_dword(pvt->branchmap_werrors,
422 FERR_FAT_FBD, value); 422 FERR_FAT_FBD, value);
423 } else { 423 } else {
424 info->ferr_fat_fbd = 0; 424 info->ferr_fat_fbd = 0;
425 info->nerr_fat_fbd = 0; 425 info->nerr_fat_fbd = 0;
@@ -437,17 +437,17 @@ static void i5000_get_error_info(struct mem_ctl_info *mci,
437 437
438 /* harvest the various error data we need */ 438 /* harvest the various error data we need */
439 pci_read_config_dword(pvt->branchmap_werrors, 439 pci_read_config_dword(pvt->branchmap_werrors,
440 NERR_NF_FBD, &info->nerr_nf_fbd); 440 NERR_NF_FBD, &info->nerr_nf_fbd);
441 pci_read_config_word(pvt->branchmap_werrors, 441 pci_read_config_word(pvt->branchmap_werrors,
442 RECMEMA, &info->recmema); 442 RECMEMA, &info->recmema);
443 pci_read_config_dword(pvt->branchmap_werrors, 443 pci_read_config_dword(pvt->branchmap_werrors,
444 RECMEMB, &info->recmemb); 444 RECMEMB, &info->recmemb);
445 pci_read_config_dword(pvt->branchmap_werrors, 445 pci_read_config_dword(pvt->branchmap_werrors,
446 REDMEMB, &info->redmemb); 446 REDMEMB, &info->redmemb);
447 447
448 /* Clear the error bits, by writing them back */ 448 /* Clear the error bits, by writing them back */
449 pci_write_config_dword(pvt->branchmap_werrors, 449 pci_write_config_dword(pvt->branchmap_werrors,
450 FERR_NF_FBD, value); 450 FERR_NF_FBD, value);
451 } else { 451 } else {
452 info->ferr_nf_fbd = 0; 452 info->ferr_nf_fbd = 0;
453 info->nerr_nf_fbd = 0; 453 info->nerr_nf_fbd = 0;
@@ -465,8 +465,8 @@ static void i5000_get_error_info(struct mem_ctl_info *mci,
465 * handle the Intel FATAL errors, if any 465 * handle the Intel FATAL errors, if any
466 */ 466 */
467static void i5000_process_fatal_error_info(struct mem_ctl_info *mci, 467static void i5000_process_fatal_error_info(struct mem_ctl_info *mci,
468 struct i5000_error_info * info, 468 struct i5000_error_info * info,
469 int handle_errors) 469 int handle_errors)
470{ 470{
471 char msg[EDAC_MC_LABEL_LEN + 1 + 90]; 471 char msg[EDAC_MC_LABEL_LEN + 1 + 90];
472 u32 allErrors; 472 u32 allErrors;
@@ -532,14 +532,14 @@ static void i5000_process_fatal_error_info(struct mem_ctl_info *mci,
532 532
533/****************************************************************************** 533/******************************************************************************
534 * i5000_process_fatal_error_info(struct mem_ctl_info *mci, 534 * i5000_process_fatal_error_info(struct mem_ctl_info *mci,
535 * struct i5000_error_info *info, 535 * struct i5000_error_info *info,
536 * int handle_errors); 536 * int handle_errors);
537 * 537 *
538 * handle the Intel NON-FATAL errors, if any 538 * handle the Intel NON-FATAL errors, if any
539 */ 539 */
540static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci, 540static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci,
541 struct i5000_error_info * info, 541 struct i5000_error_info * info,
542 int handle_errors) 542 int handle_errors)
543{ 543{
544 char msg[EDAC_MC_LABEL_LEN + 1 + 90]; 544 char msg[EDAC_MC_LABEL_LEN + 1 + 90];
545 u32 allErrors; 545 u32 allErrors;
@@ -576,10 +576,10 @@ static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci,
576 cas = NREC_CAS(info->nrecmemb); 576 cas = NREC_CAS(info->nrecmemb);
577 577
578 debugf0 578 debugf0
579 ("\t\tCSROW= %d Channels= %d,%d (Branch= %d " 579 ("\t\tCSROW= %d Channels= %d,%d (Branch= %d "
580 "DRAM Bank= %d rdwr= %s ras= %d cas= %d)\n", 580 "DRAM Bank= %d rdwr= %s ras= %d cas= %d)\n",
581 rank, channel, channel + 1, branch >> 1, bank, 581 rank, channel, channel + 1, branch >> 1, bank,
582 rdwr ? "Write" : "Read", ras, cas); 582 rdwr ? "Write" : "Read", ras, cas);
583 583
584 /* Form out message */ 584 /* Form out message */
585 snprintf(msg, sizeof(msg), 585 snprintf(msg, sizeof(msg),
@@ -632,37 +632,37 @@ static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci,
632 misc_errors = allErrors & FERR_NF_THERMAL; 632 misc_errors = allErrors & FERR_NF_THERMAL;
633 if (misc_errors) { 633 if (misc_errors) {
634 i5000_printk(KERN_WARNING, "\tTHERMAL Error, bits= 0x%x\n", 634 i5000_printk(KERN_WARNING, "\tTHERMAL Error, bits= 0x%x\n",
635 misc_errors); 635 misc_errors);
636 } 636 }
637 637
638 /* See if any of the thermal errors have fired */ 638 /* See if any of the thermal errors have fired */
639 misc_errors = allErrors & FERR_NF_NON_RETRY; 639 misc_errors = allErrors & FERR_NF_NON_RETRY;
640 if (misc_errors) { 640 if (misc_errors) {
641 i5000_printk(KERN_WARNING, "\tNON-Retry Errors, bits= 0x%x\n", 641 i5000_printk(KERN_WARNING, "\tNON-Retry Errors, bits= 0x%x\n",
642 misc_errors); 642 misc_errors);
643 } 643 }
644 644
645 /* See if any of the thermal errors have fired */ 645 /* See if any of the thermal errors have fired */
646 misc_errors = allErrors & FERR_NF_NORTH_CRC; 646 misc_errors = allErrors & FERR_NF_NORTH_CRC;
647 if (misc_errors) { 647 if (misc_errors) {
648 i5000_printk(KERN_WARNING, 648 i5000_printk(KERN_WARNING,
649 "\tNORTHBOUND CRC Error, bits= 0x%x\n", 649 "\tNORTHBOUND CRC Error, bits= 0x%x\n",
650 misc_errors); 650 misc_errors);
651 } 651 }
652 652
653 /* See if any of the thermal errors have fired */ 653 /* See if any of the thermal errors have fired */
654 misc_errors = allErrors & FERR_NF_SPD_PROTOCOL; 654 misc_errors = allErrors & FERR_NF_SPD_PROTOCOL;
655 if (misc_errors) { 655 if (misc_errors) {
656 i5000_printk(KERN_WARNING, 656 i5000_printk(KERN_WARNING,
657 "\tSPD Protocol Error, bits= 0x%x\n", 657 "\tSPD Protocol Error, bits= 0x%x\n",
658 misc_errors); 658 misc_errors);
659 } 659 }
660 660
661 /* See if any of the thermal errors have fired */ 661 /* See if any of the thermal errors have fired */
662 misc_errors = allErrors & FERR_NF_DIMM_SPARE; 662 misc_errors = allErrors & FERR_NF_DIMM_SPARE;
663 if (misc_errors) { 663 if (misc_errors) {
664 i5000_printk(KERN_WARNING, "\tDIMM-Spare Error, bits= 0x%x\n", 664 i5000_printk(KERN_WARNING, "\tDIMM-Spare Error, bits= 0x%x\n",
665 misc_errors); 665 misc_errors);
666 } 666 }
667} 667}
668 668
@@ -671,8 +671,8 @@ static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci,
671 * in the 'info' structure, previously retrieved from hardware 671 * in the 'info' structure, previously retrieved from hardware
672 */ 672 */
673static void i5000_process_error_info(struct mem_ctl_info *mci, 673static void i5000_process_error_info(struct mem_ctl_info *mci,
674 struct i5000_error_info * info, 674 struct i5000_error_info * info,
675 int handle_errors) 675 int handle_errors)
676{ 676{
677 /* First handle any fatal errors that occurred */ 677 /* First handle any fatal errors that occurred */
678 i5000_process_fatal_error_info(mci, info, handle_errors); 678 i5000_process_fatal_error_info(mci, info, handle_errors);
@@ -724,17 +724,17 @@ static int i5000_get_devices(struct mem_ctl_info *mci, int dev_idx)
724 pdev = NULL; 724 pdev = NULL;
725 while (1) { 725 while (1) {
726 pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 726 pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
727 PCI_DEVICE_ID_INTEL_I5000_DEV16, pdev); 727 PCI_DEVICE_ID_INTEL_I5000_DEV16, pdev);
728 728
729 /* End of list, leave */ 729 /* End of list, leave */
730 if (pdev == NULL) { 730 if (pdev == NULL) {
731 i5000_printk(KERN_ERR, 731 i5000_printk(KERN_ERR,
732 "'system address,Process Bus' " 732 "'system address,Process Bus' "
733 "device not found:" 733 "device not found:"
734 "vendor 0x%x device 0x%x FUNC 1 " 734 "vendor 0x%x device 0x%x FUNC 1 "
735 "(broken BIOS?)\n", 735 "(broken BIOS?)\n",
736 PCI_VENDOR_ID_INTEL, 736 PCI_VENDOR_ID_INTEL,
737 PCI_DEVICE_ID_INTEL_I5000_DEV16); 737 PCI_DEVICE_ID_INTEL_I5000_DEV16);
738 738
739 return 1; 739 return 1;
740 } 740 }
@@ -750,16 +750,16 @@ static int i5000_get_devices(struct mem_ctl_info *mci, int dev_idx)
750 pdev = NULL; 750 pdev = NULL;
751 while (1) { 751 while (1) {
752 pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 752 pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
753 PCI_DEVICE_ID_INTEL_I5000_DEV16, pdev); 753 PCI_DEVICE_ID_INTEL_I5000_DEV16, pdev);
754 754
755 if (pdev == NULL) { 755 if (pdev == NULL) {
756 i5000_printk(KERN_ERR, 756 i5000_printk(KERN_ERR,
757 "MC: 'branchmap,control,errors' " 757 "MC: 'branchmap,control,errors' "
758 "device not found:" 758 "device not found:"
759 "vendor 0x%x device 0x%x Func 2 " 759 "vendor 0x%x device 0x%x Func 2 "
760 "(broken BIOS?)\n", 760 "(broken BIOS?)\n",
761 PCI_VENDOR_ID_INTEL, 761 PCI_VENDOR_ID_INTEL,
762 PCI_DEVICE_ID_INTEL_I5000_DEV16); 762 PCI_DEVICE_ID_INTEL_I5000_DEV16);
763 763
764 pci_dev_put(pvt->branchmap_werrors); 764 pci_dev_put(pvt->branchmap_werrors);
765 return 1; 765 return 1;
@@ -784,13 +784,13 @@ static int i5000_get_devices(struct mem_ctl_info *mci, int dev_idx)
784 784
785 pdev = NULL; 785 pdev = NULL;
786 pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 786 pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
787 PCI_DEVICE_ID_I5000_BRANCH_0, pdev); 787 PCI_DEVICE_ID_I5000_BRANCH_0, pdev);
788 788
789 if (pdev == NULL) { 789 if (pdev == NULL) {
790 i5000_printk(KERN_ERR, 790 i5000_printk(KERN_ERR,
791 "MC: 'BRANCH 0' device not found:" 791 "MC: 'BRANCH 0' device not found:"
792 "vendor 0x%x device 0x%x Func 0 (broken BIOS?)\n", 792 "vendor 0x%x device 0x%x Func 0 (broken BIOS?)\n",
793 PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_I5000_BRANCH_0); 793 PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_I5000_BRANCH_0);
794 794
795 pci_dev_put(pvt->branchmap_werrors); 795 pci_dev_put(pvt->branchmap_werrors);
796 pci_dev_put(pvt->fsb_error_regs); 796 pci_dev_put(pvt->fsb_error_regs);
@@ -805,15 +805,15 @@ static int i5000_get_devices(struct mem_ctl_info *mci, int dev_idx)
805 if (pvt->maxch >= CHANNELS_PER_BRANCH) { 805 if (pvt->maxch >= CHANNELS_PER_BRANCH) {
806 pdev = NULL; 806 pdev = NULL;
807 pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 807 pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
808 PCI_DEVICE_ID_I5000_BRANCH_1, pdev); 808 PCI_DEVICE_ID_I5000_BRANCH_1, pdev);
809 809
810 if (pdev == NULL) { 810 if (pdev == NULL) {
811 i5000_printk(KERN_ERR, 811 i5000_printk(KERN_ERR,
812 "MC: 'BRANCH 1' device not found:" 812 "MC: 'BRANCH 1' device not found:"
813 "vendor 0x%x device 0x%x Func 0 " 813 "vendor 0x%x device 0x%x Func 0 "
814 "(broken BIOS?)\n", 814 "(broken BIOS?)\n",
815 PCI_VENDOR_ID_INTEL, 815 PCI_VENDOR_ID_INTEL,
816 PCI_DEVICE_ID_I5000_BRANCH_1); 816 PCI_DEVICE_ID_I5000_BRANCH_1);
817 817
818 pci_dev_put(pvt->branchmap_werrors); 818 pci_dev_put(pvt->branchmap_werrors);
819 pci_dev_put(pvt->fsb_error_regs); 819 pci_dev_put(pvt->fsb_error_regs);
@@ -917,7 +917,7 @@ static void decode_mtr(int slot_row, u16 mtr)
917} 917}
918 918
919static void handle_channel(struct i5000_pvt *pvt, int csrow, int channel, 919static void handle_channel(struct i5000_pvt *pvt, int csrow, int channel,
920 struct i5000_dimm_info *dinfo) 920 struct i5000_dimm_info *dinfo)
921{ 921{
922 int mtr; 922 int mtr;
923 int amb_present_reg; 923 int amb_present_reg;
@@ -932,7 +932,7 @@ static void handle_channel(struct i5000_pvt *pvt, int csrow, int channel,
932 dinfo->dual_rank = MTR_DIMM_RANK(mtr); 932 dinfo->dual_rank = MTR_DIMM_RANK(mtr);
933 933
934 if (!((dinfo->dual_rank == 0) && 934 if (!((dinfo->dual_rank == 0) &&
935 ((csrow & 0x1) == 0x1))) { 935 ((csrow & 0x1) == 0x1))) {
936 /* Start with the number of bits for a Bank 936 /* Start with the number of bits for a Bank
937 * on the DRAM */ 937 * on the DRAM */
938 addrBits = MTR_DRAM_BANKS_ADDR_BITS(mtr); 938 addrBits = MTR_DRAM_BANKS_ADDR_BITS(mtr);
@@ -970,7 +970,7 @@ static void calculate_dimm_size(struct i5000_pvt *pvt)
970 mem_buffer = p = kmalloc(space, GFP_KERNEL); 970 mem_buffer = p = kmalloc(space, GFP_KERNEL);
971 if (p == NULL) { 971 if (p == NULL) {
972 i5000_printk(KERN_ERR, "MC: %s:%s() kmalloc() failed\n", 972 i5000_printk(KERN_ERR, "MC: %s:%s() kmalloc() failed\n",
973 __FILE__, __func__); 973 __FILE__, __func__);
974 return; 974 return;
975 } 975 }
976 976
@@ -990,7 +990,7 @@ static void calculate_dimm_size(struct i5000_pvt *pvt)
990 * then reset the message buffer */ 990 * then reset the message buffer */
991 if (csrow & 0x1) { 991 if (csrow & 0x1) {
992 n = snprintf(p, space, "---------------------------" 992 n = snprintf(p, space, "---------------------------"
993 "--------------------------------"); 993 "--------------------------------");
994 p += n; 994 p += n;
995 space -= n; 995 space -= n;
996 debugf2("%s\n", mem_buffer); 996 debugf2("%s\n", mem_buffer);
@@ -1015,7 +1015,7 @@ static void calculate_dimm_size(struct i5000_pvt *pvt)
1015 1015
1016 /* Output the last bottom 'boundary' marker */ 1016 /* Output the last bottom 'boundary' marker */
1017 n = snprintf(p, space, "---------------------------" 1017 n = snprintf(p, space, "---------------------------"
1018 "--------------------------------\n"); 1018 "--------------------------------\n");
1019 p += n; 1019 p += n;
1020 space -= n; 1020 space -= n;
1021 1021
@@ -1056,9 +1056,9 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci)
1056 pvt = (struct i5000_pvt *)mci->pvt_info; 1056 pvt = (struct i5000_pvt *)mci->pvt_info;
1057 1057
1058 pci_read_config_dword(pvt->system_address, AMBASE, 1058 pci_read_config_dword(pvt->system_address, AMBASE,
1059 (u32 *) & pvt->ambase); 1059 (u32 *) & pvt->ambase);
1060 pci_read_config_dword(pvt->system_address, AMBASE + sizeof(u32), 1060 pci_read_config_dword(pvt->system_address, AMBASE + sizeof(u32),
1061 ((u32 *) & pvt->ambase) + sizeof(u32)); 1061 ((u32 *) & pvt->ambase) + sizeof(u32));
1062 1062
1063 maxdimmperch = pvt->maxdimmperch; 1063 maxdimmperch = pvt->maxdimmperch;
1064 maxch = pvt->maxch; 1064 maxch = pvt->maxch;
@@ -1098,14 +1098,14 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci)
1098 int where = MTR0 + (slot_row * sizeof(u32)); 1098 int where = MTR0 + (slot_row * sizeof(u32));
1099 1099
1100 pci_read_config_word(pvt->branch_0, where, 1100 pci_read_config_word(pvt->branch_0, where,
1101 &pvt->b0_mtr[slot_row]); 1101 &pvt->b0_mtr[slot_row]);
1102 1102
1103 debugf2("MTR%d where=0x%x B0 value=0x%x\n", slot_row, where, 1103 debugf2("MTR%d where=0x%x B0 value=0x%x\n", slot_row, where,
1104 pvt->b0_mtr[slot_row]); 1104 pvt->b0_mtr[slot_row]);
1105 1105
1106 if (pvt->maxch >= CHANNELS_PER_BRANCH) { 1106 if (pvt->maxch >= CHANNELS_PER_BRANCH) {
1107 pci_read_config_word(pvt->branch_1, where, 1107 pci_read_config_word(pvt->branch_1, where,
1108 &pvt->b1_mtr[slot_row]); 1108 &pvt->b1_mtr[slot_row]);
1109 debugf2("MTR%d where=0x%x B1 value=0x%x\n", slot_row, 1109 debugf2("MTR%d where=0x%x B1 value=0x%x\n", slot_row,
1110 where, pvt->b0_mtr[slot_row]); 1110 where, pvt->b0_mtr[slot_row]);
1111 } else { 1111 } else {
@@ -1120,10 +1120,10 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci)
1120 decode_mtr(slot_row, pvt->b0_mtr[slot_row]); 1120 decode_mtr(slot_row, pvt->b0_mtr[slot_row]);
1121 } 1121 }
1122 pci_read_config_word(pvt->branch_0, AMB_PRESENT_0, 1122 pci_read_config_word(pvt->branch_0, AMB_PRESENT_0,
1123 &pvt->b0_ambpresent0); 1123 &pvt->b0_ambpresent0);
1124 debugf2("\t\tAMB-Branch 0-present0 0x%x:\n", pvt->b0_ambpresent0); 1124 debugf2("\t\tAMB-Branch 0-present0 0x%x:\n", pvt->b0_ambpresent0);
1125 pci_read_config_word(pvt->branch_0, AMB_PRESENT_1, 1125 pci_read_config_word(pvt->branch_0, AMB_PRESENT_1,
1126 &pvt->b0_ambpresent1); 1126 &pvt->b0_ambpresent1);
1127 debugf2("\t\tAMB-Branch 0-present1 0x%x:\n", pvt->b0_ambpresent1); 1127 debugf2("\t\tAMB-Branch 0-present1 0x%x:\n", pvt->b0_ambpresent1);
1128 1128
1129 /* Only if we have 2 branchs (4 channels) */ 1129 /* Only if we have 2 branchs (4 channels) */
@@ -1137,11 +1137,11 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci)
1137 decode_mtr(slot_row, pvt->b1_mtr[slot_row]); 1137 decode_mtr(slot_row, pvt->b1_mtr[slot_row]);
1138 } 1138 }
1139 pci_read_config_word(pvt->branch_1, AMB_PRESENT_0, 1139 pci_read_config_word(pvt->branch_1, AMB_PRESENT_0,
1140 &pvt->b1_ambpresent0); 1140 &pvt->b1_ambpresent0);
1141 debugf2("\t\tAMB-Branch 1-present0 0x%x:\n", 1141 debugf2("\t\tAMB-Branch 1-present0 0x%x:\n",
1142 pvt->b1_ambpresent0); 1142 pvt->b1_ambpresent0);
1143 pci_read_config_word(pvt->branch_1, AMB_PRESENT_1, 1143 pci_read_config_word(pvt->branch_1, AMB_PRESENT_1,
1144 &pvt->b1_ambpresent1); 1144 &pvt->b1_ambpresent1);
1145 debugf2("\t\tAMB-Branch 1-present1 0x%x:\n", 1145 debugf2("\t\tAMB-Branch 1-present1 0x%x:\n",
1146 pvt->b1_ambpresent1); 1146 pvt->b1_ambpresent1);
1147 } 1147 }
@@ -1234,13 +1234,13 @@ static void i5000_enable_error_reporting(struct mem_ctl_info *mci)
1234 1234
1235 /* Read the FBD Error Mask Register */ 1235 /* Read the FBD Error Mask Register */
1236 pci_read_config_dword(pvt->branchmap_werrors, EMASK_FBD, 1236 pci_read_config_dword(pvt->branchmap_werrors, EMASK_FBD,
1237 &fbd_error_mask); 1237 &fbd_error_mask);
1238 1238
1239 /* Enable with a '0' */ 1239 /* Enable with a '0' */
1240 fbd_error_mask &= ~(ENABLE_EMASK_ALL); 1240 fbd_error_mask &= ~(ENABLE_EMASK_ALL);
1241 1241
1242 pci_write_config_dword(pvt->branchmap_werrors, EMASK_FBD, 1242 pci_write_config_dword(pvt->branchmap_werrors, EMASK_FBD,
1243 fbd_error_mask); 1243 fbd_error_mask);
1244} 1244}
1245 1245
1246/****************************************************************************** 1246/******************************************************************************
@@ -1250,8 +1250,8 @@ static void i5000_enable_error_reporting(struct mem_ctl_info *mci)
1250 * as well 1250 * as well
1251 */ 1251 */
1252static void i5000_get_dimm_and_channel_counts(struct pci_dev *pdev, 1252static void i5000_get_dimm_and_channel_counts(struct pci_dev *pdev,
1253 int *num_dimms_per_channel, 1253 int *num_dimms_per_channel,
1254 int *num_channels) 1254 int *num_channels)
1255{ 1255{
1256 u8 value; 1256 u8 value;
1257 1257
@@ -1313,7 +1313,7 @@ static int i5000_probe1(struct pci_dev *pdev, int dev_idx)
1313 * some fancy mobo determination. 1313 * some fancy mobo determination.
1314 */ 1314 */
1315 i5000_get_dimm_and_channel_counts(pdev, &num_dimms_per_channel, 1315 i5000_get_dimm_and_channel_counts(pdev, &num_dimms_per_channel,
1316 &num_channels); 1316 &num_channels);
1317 num_csrows = num_dimms_per_channel * 2; 1317 num_csrows = num_dimms_per_channel * 2;
1318 1318
1319 debugf0("MC: %s(): Number of - Channels= %d DIMMS= %d CSROWS= %d\n", 1319 debugf0("MC: %s(): Number of - Channels= %d DIMMS= %d CSROWS= %d\n",
@@ -1392,11 +1392,11 @@ static int i5000_probe1(struct pci_dev *pdev, int dev_idx)
1392 return 0; 1392 return 0;
1393 1393
1394 /* Error exit unwinding stack */ 1394 /* Error exit unwinding stack */
1395 fail1: 1395fail1:
1396 1396
1397 i5000_put_devices(mci); 1397 i5000_put_devices(mci);
1398 1398
1399 fail0: 1399fail0:
1400 edac_mc_free(mci); 1400 edac_mc_free(mci);
1401 return -ENODEV; 1401 return -ENODEV;
1402} 1402}
@@ -1409,7 +1409,7 @@ static int i5000_probe1(struct pci_dev *pdev, int dev_idx)
1409 * count (>= 0) 1409 * count (>= 0)
1410 */ 1410 */
1411static int __devinit i5000_init_one(struct pci_dev *pdev, 1411static int __devinit i5000_init_one(struct pci_dev *pdev,
1412 const struct pci_device_id *id) 1412 const struct pci_device_id *id)
1413{ 1413{
1414 int rc; 1414 int rc;
1415 1415
@@ -1503,6 +1503,6 @@ MODULE_LICENSE("GPL");
1503MODULE_AUTHOR 1503MODULE_AUTHOR
1504 ("Linux Networx (http://lnxi.com) Doug Thompson <norsk5@xmission.com>"); 1504 ("Linux Networx (http://lnxi.com) Doug Thompson <norsk5@xmission.com>");
1505MODULE_DESCRIPTION("MC Driver for Intel I5000 memory controllers - " 1505MODULE_DESCRIPTION("MC Driver for Intel I5000 memory controllers - "
1506 I5000_REVISION); 1506 I5000_REVISION);
1507module_param(edac_op_state, int, 0444); 1507module_param(edac_op_state, int, 0444);
1508MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); 1508MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
diff --git a/drivers/edac/i82443bxgx_edac.c b/drivers/edac/i82443bxgx_edac.c
index d190104081ca..445ed56558f1 100644
--- a/drivers/edac/i82443bxgx_edac.c
+++ b/drivers/edac/i82443bxgx_edac.c
@@ -114,8 +114,8 @@ struct i82443bxgx_edacmc_error_info {
114static struct edac_pci_ctl_info *i82443bxgx_pci; 114static struct edac_pci_ctl_info *i82443bxgx_pci;
115 115
116static void i82443bxgx_edacmc_get_error_info(struct mem_ctl_info *mci, 116static void i82443bxgx_edacmc_get_error_info(struct mem_ctl_info *mci,
117 struct i82443bxgx_edacmc_error_info 117 struct i82443bxgx_edacmc_error_info
118 *info) 118 *info)
119{ 119{
120 struct pci_dev *pdev; 120 struct pci_dev *pdev;
121 pdev = to_pci_dev(mci->dev); 121 pdev = to_pci_dev(mci->dev);
@@ -151,17 +151,18 @@ static int i82443bxgx_edacmc_process_error_info(struct mem_ctl_info *mci,
151 error_found = 1; 151 error_found = 1;
152 if (handle_errors) 152 if (handle_errors)
153 edac_mc_handle_ce(mci, page, pageoffset, 153 edac_mc_handle_ce(mci, page, pageoffset,
154 /* 440BX/GX don't make syndrome information available */ 154 /* 440BX/GX don't make syndrome information
155 0, edac_mc_find_csrow_by_page(mci, page), 0, /* channel */ 155 * available */
156 mci->ctl_name); 156 0, edac_mc_find_csrow_by_page(mci, page), 0,
157 mci->ctl_name);
157 } 158 }
158 159
159 if (info->eap & I82443BXGX_EAP_OFFSET_MBE) { 160 if (info->eap & I82443BXGX_EAP_OFFSET_MBE) {
160 error_found = 1; 161 error_found = 1;
161 if (handle_errors) 162 if (handle_errors)
162 edac_mc_handle_ue(mci, page, pageoffset, 163 edac_mc_handle_ue(mci, page, pageoffset,
163 edac_mc_find_csrow_by_page(mci, page), 164 edac_mc_find_csrow_by_page(mci, page),
164 mci->ctl_name); 165 mci->ctl_name);
165 } 166 }
166 167
167 return error_found; 168 return error_found;
@@ -177,9 +178,9 @@ static void i82443bxgx_edacmc_check(struct mem_ctl_info *mci)
177} 178}
178 179
179static void i82443bxgx_init_csrows(struct mem_ctl_info *mci, 180static void i82443bxgx_init_csrows(struct mem_ctl_info *mci,
180 struct pci_dev *pdev, 181 struct pci_dev *pdev,
181 enum edac_type edac_mode, 182 enum edac_type edac_mode,
182 enum mem_type mtype) 183 enum mem_type mtype)
183{ 184{
184 struct csrow_info *csrow; 185 struct csrow_info *csrow;
185 int index; 186 int index;
@@ -233,7 +234,8 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
233 debugf0("MC: " __FILE__ ": %s()\n", __func__); 234 debugf0("MC: " __FILE__ ": %s()\n", __func__);
234 235
235 /* Something is really hosed if PCI config space reads from 236 /* Something is really hosed if PCI config space reads from
236 the MC aren't working. */ 237 * the MC aren't working.
238 */
237 if (pci_read_config_dword(pdev, I82443BXGX_NBXCFG, &nbxcfg)) 239 if (pci_read_config_dword(pdev, I82443BXGX_NBXCFG, &nbxcfg))
238 return -EIO; 240 return -EIO;
239 241
@@ -258,8 +260,8 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
258 mtype = MEM_RDR; 260 mtype = MEM_RDR;
259 break; 261 break;
260 default: 262 default:
261 debugf0 263 debugf0("Unknown/reserved DRAM type value "
262 ("Unknown/reserved DRAM type value in DRAMC register!\n"); 264 "in DRAMC register!\n");
263 mtype = -MEM_UNKNOWN; 265 mtype = -MEM_UNKNOWN;
264 } 266 }
265 267
@@ -271,10 +273,10 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
271 mci->scrub_cap = SCRUB_FLAG_HW_SRC; 273 mci->scrub_cap = SCRUB_FLAG_HW_SRC;
272 pci_read_config_dword(pdev, I82443BXGX_NBXCFG, &nbxcfg); 274 pci_read_config_dword(pdev, I82443BXGX_NBXCFG, &nbxcfg);
273 ecc_mode = ((nbxcfg >> I82443BXGX_NBXCFG_OFFSET_DRAM_INTEGRITY) & 275 ecc_mode = ((nbxcfg >> I82443BXGX_NBXCFG_OFFSET_DRAM_INTEGRITY) &
274 (BIT(0) | BIT(1))); 276 (BIT(0) | BIT(1)));
275 277
276 mci->scrub_mode = (ecc_mode == I82443BXGX_NBXCFG_INTEGRITY_SCRUB) 278 mci->scrub_mode = (ecc_mode == I82443BXGX_NBXCFG_INTEGRITY_SCRUB)
277 ? SCRUB_HW_SRC : SCRUB_NONE; 279 ? SCRUB_HW_SRC : SCRUB_NONE;
278 280
279 switch (ecc_mode) { 281 switch (ecc_mode) {
280 case I82443BXGX_NBXCFG_INTEGRITY_NONE: 282 case I82443BXGX_NBXCFG_INTEGRITY_NONE:
@@ -288,9 +290,8 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
288 edac_mode = EDAC_SECDED; 290 edac_mode = EDAC_SECDED;
289 break; 291 break;
290 default: 292 default:
291 debugf0 293 debugf0("%s(): Unknown/reserved ECC state "
292 ("%s(): Unknown/reserved ECC state in NBXCFG register!\n", 294 "in NBXCFG register!\n", __func__);
293 __func__);
294 edac_mode = EDAC_UNKNOWN; 295 edac_mode = EDAC_UNKNOWN;
295 break; 296 break;
296 } 297 }
@@ -301,10 +302,10 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
301 * here, or we get "phantom" errors occuring at module-load 302 * here, or we get "phantom" errors occuring at module-load
302 * time. */ 303 * time. */
303 pci_write_bits32(pdev, I82443BXGX_EAP, 304 pci_write_bits32(pdev, I82443BXGX_EAP,
304 (I82443BXGX_EAP_OFFSET_SBE | 305 (I82443BXGX_EAP_OFFSET_SBE |
305 I82443BXGX_EAP_OFFSET_MBE), 306 I82443BXGX_EAP_OFFSET_MBE),
306 (I82443BXGX_EAP_OFFSET_SBE | 307 (I82443BXGX_EAP_OFFSET_SBE |
307 I82443BXGX_EAP_OFFSET_MBE)); 308 I82443BXGX_EAP_OFFSET_MBE));
308 309
309 mci->mod_name = EDAC_MOD_STR; 310 mci->mod_name = EDAC_MOD_STR;
310 mci->mod_ver = I82443_REVISION; 311 mci->mod_ver = I82443_REVISION;
@@ -332,7 +333,7 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
332 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 333 debugf3("MC: " __FILE__ ": %s(): success\n", __func__);
333 return 0; 334 return 0;
334 335
335 fail: 336fail:
336 edac_mc_free(mci); 337 edac_mc_free(mci);
337 return -ENODEV; 338 return -ENODEV;
338} 339}
diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c
index db8a864f16f6..9fdd76e157f8 100644
--- a/drivers/edac/i82860_edac.c
+++ b/drivers/edac/i82860_edac.c
@@ -54,7 +54,7 @@ struct i82860_error_info {
54 54
55static const struct i82860_dev_info i82860_devs[] = { 55static const struct i82860_dev_info i82860_devs[] = {
56 [I82860] = { 56 [I82860] = {
57 .ctl_name = "i82860"}, 57 .ctl_name = "i82860"},
58}; 58};
59 59
60static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code 60static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code
@@ -63,7 +63,7 @@ static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code
63static struct edac_pci_ctl_info *i82860_pci; 63static struct edac_pci_ctl_info *i82860_pci;
64 64
65static void i82860_get_error_info(struct mem_ctl_info *mci, 65static void i82860_get_error_info(struct mem_ctl_info *mci,
66 struct i82860_error_info *info) 66 struct i82860_error_info *info)
67{ 67{
68 struct pci_dev *pdev; 68 struct pci_dev *pdev;
69 69
@@ -96,8 +96,8 @@ static void i82860_get_error_info(struct mem_ctl_info *mci,
96} 96}
97 97
98static int i82860_process_error_info(struct mem_ctl_info *mci, 98static int i82860_process_error_info(struct mem_ctl_info *mci,
99 struct i82860_error_info *info, 99 struct i82860_error_info *info,
100 int handle_errors) 100 int handle_errors)
101{ 101{
102 int row; 102 int row;
103 103
@@ -119,7 +119,7 @@ static int i82860_process_error_info(struct mem_ctl_info *mci,
119 edac_mc_handle_ue(mci, info->eap, 0, row, "i82860 UE"); 119 edac_mc_handle_ue(mci, info->eap, 0, row, "i82860 UE");
120 else 120 else
121 edac_mc_handle_ce(mci, info->eap, 0, info->derrsyn, row, 0, 121 edac_mc_handle_ce(mci, info->eap, 0, info->derrsyn, row, 0,
122 "i82860 UE"); 122 "i82860 UE");
123 123
124 return 1; 124 return 1;
125} 125}
@@ -155,7 +155,7 @@ static void i82860_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev)
155 csrow = &mci->csrows[index]; 155 csrow = &mci->csrows[index];
156 pci_read_config_word(pdev, I82860_GBA + index * 2, &value); 156 pci_read_config_word(pdev, I82860_GBA + index * 2, &value);
157 cumul_size = (value & I82860_GBA_MASK) << 157 cumul_size = (value & I82860_GBA_MASK) <<
158 (I82860_GBA_SHIFT - PAGE_SHIFT); 158 (I82860_GBA_SHIFT - PAGE_SHIFT);
159 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, 159 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
160 cumul_size); 160 cumul_size);
161 161
@@ -230,14 +230,14 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
230 230
231 return 0; 231 return 0;
232 232
233 fail: 233fail:
234 edac_mc_free(mci); 234 edac_mc_free(mci);
235 return -ENODEV; 235 return -ENODEV;
236} 236}
237 237
238/* returns count (>= 0), or negative on error */ 238/* returns count (>= 0), or negative on error */
239static int __devinit i82860_init_one(struct pci_dev *pdev, 239static int __devinit i82860_init_one(struct pci_dev *pdev,
240 const struct pci_device_id *ent) 240 const struct pci_device_id *ent)
241{ 241{
242 int rc; 242 int rc;
243 243
@@ -299,7 +299,7 @@ static int __init i82860_init(void)
299 299
300 if (!mci_pdev) { 300 if (!mci_pdev) {
301 mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 301 mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
302 PCI_DEVICE_ID_INTEL_82860_0, NULL); 302 PCI_DEVICE_ID_INTEL_82860_0, NULL);
303 303
304 if (mci_pdev == NULL) { 304 if (mci_pdev == NULL) {
305 debugf0("860 pci_get_device fail\n"); 305 debugf0("860 pci_get_device fail\n");
@@ -318,10 +318,10 @@ static int __init i82860_init(void)
318 318
319 return 0; 319 return 0;
320 320
321 fail1: 321fail1:
322 pci_unregister_driver(&i82860_driver); 322 pci_unregister_driver(&i82860_driver);
323 323
324 fail0: 324fail0:
325 if (mci_pdev != NULL) 325 if (mci_pdev != NULL)
326 pci_dev_put(mci_pdev); 326 pci_dev_put(mci_pdev);
327 327
@@ -343,5 +343,5 @@ module_exit(i82860_exit);
343 343
344MODULE_LICENSE("GPL"); 344MODULE_LICENSE("GPL");
345MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com) " 345MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com) "
346 "Ben Woodard <woodard@redhat.com>"); 346 "Ben Woodard <woodard@redhat.com>");
347MODULE_DESCRIPTION("ECC support for Intel 82860 memory hub controllers"); 347MODULE_DESCRIPTION("ECC support for Intel 82860 memory hub controllers");
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c
index 214112b5e52a..c9aed70fec8e 100644
--- a/drivers/edac/i82875p_edac.c
+++ b/drivers/edac/i82875p_edac.c
@@ -174,7 +174,7 @@ struct i82875p_error_info {
174 174
175static const struct i82875p_dev_info i82875p_devs[] = { 175static const struct i82875p_dev_info i82875p_devs[] = {
176 [I82875P] = { 176 [I82875P] = {
177 .ctl_name = "i82875p"}, 177 .ctl_name = "i82875p"},
178}; 178};
179 179
180static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code has 180static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code has
@@ -186,7 +186,7 @@ static int i82875p_registered = 1;
186static struct edac_pci_ctl_info *i82875p_pci; 186static struct edac_pci_ctl_info *i82875p_pci;
187 187
188static void i82875p_get_error_info(struct mem_ctl_info *mci, 188static void i82875p_get_error_info(struct mem_ctl_info *mci,
189 struct i82875p_error_info *info) 189 struct i82875p_error_info *info)
190{ 190{
191 struct pci_dev *pdev; 191 struct pci_dev *pdev;
192 192
@@ -222,8 +222,8 @@ static void i82875p_get_error_info(struct mem_ctl_info *mci,
222} 222}
223 223
224static int i82875p_process_error_info(struct mem_ctl_info *mci, 224static int i82875p_process_error_info(struct mem_ctl_info *mci,
225 struct i82875p_error_info *info, 225 struct i82875p_error_info *info,
226 int handle_errors) 226 int handle_errors)
227{ 227{
228 int row, multi_chan; 228 int row, multi_chan;
229 229
@@ -247,8 +247,8 @@ static int i82875p_process_error_info(struct mem_ctl_info *mci,
247 edac_mc_handle_ue(mci, info->eap, 0, row, "i82875p UE"); 247 edac_mc_handle_ue(mci, info->eap, 0, row, "i82875p UE");
248 else 248 else
249 edac_mc_handle_ce(mci, info->eap, 0, info->derrsyn, row, 249 edac_mc_handle_ce(mci, info->eap, 0, info->derrsyn, row,
250 multi_chan ? (info->des & 0x1) : 0, 250 multi_chan ? (info->des & 0x1) : 0,
251 "i82875p CE"); 251 "i82875p CE");
252 252
253 return 1; 253 return 1;
254} 254}
@@ -264,8 +264,8 @@ static void i82875p_check(struct mem_ctl_info *mci)
264 264
265/* Return 0 on success or 1 on failure. */ 265/* Return 0 on success or 1 on failure. */
266static int i82875p_setup_overfl_dev(struct pci_dev *pdev, 266static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
267 struct pci_dev **ovrfl_pdev, 267 struct pci_dev **ovrfl_pdev,
268 void __iomem ** ovrfl_window) 268 void __iomem **ovrfl_window)
269{ 269{
270 struct pci_dev *dev; 270 struct pci_dev *dev;
271 void __iomem *window; 271 void __iomem *window;
@@ -293,7 +293,7 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
293 293
294 if (pci_enable_device(dev)) { 294 if (pci_enable_device(dev)) {
295 i82875p_printk(KERN_ERR, "%s(): Failed to enable overflow " 295 i82875p_printk(KERN_ERR, "%s(): Failed to enable overflow "
296 "device\n", __func__); 296 "device\n", __func__);
297 return 1; 297 return 1;
298 } 298 }
299 299
@@ -309,18 +309,18 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
309 309
310 if (window == NULL) { 310 if (window == NULL) {
311 i82875p_printk(KERN_ERR, "%s(): Failed to ioremap bar6\n", 311 i82875p_printk(KERN_ERR, "%s(): Failed to ioremap bar6\n",
312 __func__); 312 __func__);
313 goto fail1; 313 goto fail1;
314 } 314 }
315 315
316 *ovrfl_window = window; 316 *ovrfl_window = window;
317 return 0; 317 return 0;
318 318
319 fail1: 319fail1:
320 pci_release_regions(dev); 320 pci_release_regions(dev);
321 321
322#ifdef CORRECT_BIOS 322#ifdef CORRECT_BIOS
323 fail0: 323fail0:
324 pci_disable_device(dev); 324 pci_disable_device(dev);
325#endif 325#endif
326 /* NOTE: the ovrfl proc entry and pci_dev are intentionally left */ 326 /* NOTE: the ovrfl proc entry and pci_dev are intentionally left */
@@ -393,7 +393,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
393 drc = readl(ovrfl_window + I82875P_DRC); 393 drc = readl(ovrfl_window + I82875P_DRC);
394 nr_chans = dual_channel_active(drc) + 1; 394 nr_chans = dual_channel_active(drc) + 1;
395 mci = edac_mc_alloc(sizeof(*pvt), I82875P_NR_CSROWS(nr_chans), 395 mci = edac_mc_alloc(sizeof(*pvt), I82875P_NR_CSROWS(nr_chans),
396 nr_chans); 396 nr_chans);
397 397
398 if (!mci) { 398 if (!mci) {
399 rc = -ENOMEM; 399 rc = -ENOMEM;
@@ -441,10 +441,10 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
441 debugf3("%s(): success\n", __func__); 441 debugf3("%s(): success\n", __func__);
442 return 0; 442 return 0;
443 443
444 fail1: 444fail1:
445 edac_mc_free(mci); 445 edac_mc_free(mci);
446 446
447 fail0: 447fail0:
448 iounmap(ovrfl_window); 448 iounmap(ovrfl_window);
449 pci_release_regions(ovrfl_pdev); 449 pci_release_regions(ovrfl_pdev);
450 450
@@ -455,7 +455,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
455 455
456/* returns count (>= 0), or negative on error */ 456/* returns count (>= 0), or negative on error */
457static int __devinit i82875p_init_one(struct pci_dev *pdev, 457static int __devinit i82875p_init_one(struct pci_dev *pdev,
458 const struct pci_device_id *ent) 458 const struct pci_device_id *ent)
459{ 459{
460 int rc; 460 int rc;
461 461
@@ -532,7 +532,7 @@ static int __init i82875p_init(void)
532 532
533 if (mci_pdev == NULL) { 533 if (mci_pdev == NULL) {
534 mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 534 mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
535 PCI_DEVICE_ID_INTEL_82875_0, NULL); 535 PCI_DEVICE_ID_INTEL_82875_0, NULL);
536 536
537 if (!mci_pdev) { 537 if (!mci_pdev) {
538 debugf0("875p pci_get_device fail\n"); 538 debugf0("875p pci_get_device fail\n");
@@ -551,10 +551,10 @@ static int __init i82875p_init(void)
551 551
552 return 0; 552 return 0;
553 553
554 fail1: 554fail1:
555 pci_unregister_driver(&i82875p_driver); 555 pci_unregister_driver(&i82875p_driver);
556 556
557 fail0: 557fail0:
558 if (mci_pdev != NULL) 558 if (mci_pdev != NULL)
559 pci_dev_put(mci_pdev); 559 pci_dev_put(mci_pdev);
560 560
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index 8097f2faaa8c..0a971ebdccec 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -136,7 +136,7 @@ static unsigned int disable_hardware_scrub = 0;
136static struct edac_pci_ctl_info *r82600_pci; 136static struct edac_pci_ctl_info *r82600_pci;
137 137
138static void r82600_get_error_info(struct mem_ctl_info *mci, 138static void r82600_get_error_info(struct mem_ctl_info *mci,
139 struct r82600_error_info *info) 139 struct r82600_error_info *info)
140{ 140{
141 struct pci_dev *pdev; 141 struct pci_dev *pdev;
142 142
@@ -157,8 +157,8 @@ static void r82600_get_error_info(struct mem_ctl_info *mci,
157} 157}
158 158
159static int r82600_process_error_info(struct mem_ctl_info *mci, 159static int r82600_process_error_info(struct mem_ctl_info *mci,
160 struct r82600_error_info *info, 160 struct r82600_error_info *info,
161 int handle_errors) 161 int handle_errors)
162{ 162{
163 int error_found; 163 int error_found;
164 u32 eapaddr, page; 164 u32 eapaddr, page;
@@ -180,8 +180,9 @@ static int r82600_process_error_info(struct mem_ctl_info *mci,
180 180
181 if (handle_errors) 181 if (handle_errors)
182 edac_mc_handle_ce(mci, page, 0, /* not avail */ 182 edac_mc_handle_ce(mci, page, 0, /* not avail */
183 syndrome, edac_mc_find_csrow_by_page(mci, page), 0, /* channel */ 183 syndrome,
184 mci->ctl_name); 184 edac_mc_find_csrow_by_page(mci, page),
185 0, mci->ctl_name);
185 } 186 }
186 187
187 if (info->eapr & BIT(1)) { /* UE? */ 188 if (info->eapr & BIT(1)) { /* UE? */
@@ -190,8 +191,8 @@ static int r82600_process_error_info(struct mem_ctl_info *mci,
190 if (handle_errors) 191 if (handle_errors)
191 /* 82600 doesn't give enough info */ 192 /* 82600 doesn't give enough info */
192 edac_mc_handle_ue(mci, page, 0, 193 edac_mc_handle_ue(mci, page, 0,
193 edac_mc_find_csrow_by_page(mci, page), 194 edac_mc_find_csrow_by_page(mci, page),
194 mci->ctl_name); 195 mci->ctl_name);
195 } 196 }
196 197
197 return error_found; 198 return error_found;
@@ -212,7 +213,7 @@ static inline int ecc_enabled(u8 dramcr)
212} 213}
213 214
214static void r82600_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, 215static void r82600_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
215 u8 dramcr) 216 u8 dramcr)
216{ 217{
217 struct csrow_info *csrow; 218 struct csrow_info *csrow;
218 int index; 219 int index;
@@ -342,14 +343,14 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
342 debugf3("%s(): success\n", __func__); 343 debugf3("%s(): success\n", __func__);
343 return 0; 344 return 0;
344 345
345 fail: 346fail:
346 edac_mc_free(mci); 347 edac_mc_free(mci);
347 return -ENODEV; 348 return -ENODEV;
348} 349}
349 350
350/* returns count (>= 0), or negative on error */ 351/* returns count (>= 0), or negative on error */
351static int __devinit r82600_init_one(struct pci_dev *pdev, 352static int __devinit r82600_init_one(struct pci_dev *pdev,
352 const struct pci_device_id *ent) 353 const struct pci_device_id *ent)
353{ 354{
354 debugf0("%s()\n", __func__); 355 debugf0("%s()\n", __func__);
355 356
@@ -405,7 +406,7 @@ module_exit(r82600_exit);
405 406
406MODULE_LICENSE("GPL"); 407MODULE_LICENSE("GPL");
407MODULE_AUTHOR("Tim Small <tim@buttersideup.com> - WPAD Ltd. " 408MODULE_AUTHOR("Tim Small <tim@buttersideup.com> - WPAD Ltd. "
408 "on behalf of EADS Astrium"); 409 "on behalf of EADS Astrium");
409MODULE_DESCRIPTION("MC support for Radisys 82600 memory controllers"); 410MODULE_DESCRIPTION("MC support for Radisys 82600 memory controllers");
410 411
411module_param(disable_hardware_scrub, bool, 0644); 412module_param(disable_hardware_scrub, bool, 0644);