aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHitoshi Mitake <h.mitake@gmail.com>2008-04-29 04:03:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:26 -0400
commitc3c52bce6993c6d37af2c2de9b482a7013d646a7 (patch)
treedc03a88574a0029af51aad044c449cb90e52247f /drivers
parent1a45027d1afd7e85254b5ef8535e93ce3d588cf4 (diff)
edac: fix module initialization on several modules 2nd time
I implemented opstate_init() as a inline function in linux/edac.h. added calling opstate_init() to: i82443bxgx_edac.c i82860_edac.c i82875p_edac.c i82975x_edac.c I wrote a fixed patch of edac-fix-module-initialization-on-several-modules.patch, and tested building 2.6.25-rc7 with applying this. It was succeed. I think the patch is now correct. Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com> Signed-off-by: Doug 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')
-rw-r--r--drivers/edac/amd76x_edac.c7
-rw-r--r--drivers/edac/e752x_edac.c15
-rw-r--r--drivers/edac/e7xxx_edac.c13
-rw-r--r--drivers/edac/i3000_edac.c13
-rw-r--r--drivers/edac/i5000_edac.c14
-rw-r--r--drivers/edac/i82443bxgx_edac.c7
-rw-r--r--drivers/edac/i82860_edac.c7
-rw-r--r--drivers/edac/i82875p_edac.c9
-rw-r--r--drivers/edac/i82975x_edac.c8
-rw-r--r--drivers/edac/pasemi_edac.c6
-rw-r--r--drivers/edac/r82600_edac.c7
11 files changed, 66 insertions, 40 deletions
diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c
index f22075410591..2b95f1a3edfc 100644
--- a/drivers/edac/amd76x_edac.c
+++ b/drivers/edac/amd76x_edac.c
@@ -17,6 +17,7 @@
17#include <linux/pci.h> 17#include <linux/pci.h>
18#include <linux/pci_ids.h> 18#include <linux/pci_ids.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/edac.h>
20#include "edac_core.h" 21#include "edac_core.h"
21 22
22#define AMD76X_REVISION " Ver: 2.0.2 " __DATE__ 23#define AMD76X_REVISION " Ver: 2.0.2 " __DATE__
@@ -344,6 +345,9 @@ static struct pci_driver amd76x_driver = {
344 345
345static int __init amd76x_init(void) 346static int __init amd76x_init(void)
346{ 347{
348 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
349 opstate_init();
350
347 return pci_register_driver(&amd76x_driver); 351 return pci_register_driver(&amd76x_driver);
348} 352}
349 353
@@ -358,3 +362,6 @@ module_exit(amd76x_exit);
358MODULE_LICENSE("GPL"); 362MODULE_LICENSE("GPL");
359MODULE_AUTHOR("Linux Networx (http://lnxi.com) Thayne Harbaugh"); 363MODULE_AUTHOR("Linux Networx (http://lnxi.com) Thayne Harbaugh");
360MODULE_DESCRIPTION("MC support for AMD 76x memory controllers"); 364MODULE_DESCRIPTION("MC support for AMD 76x memory controllers");
365
366module_param(edac_op_state, int, 0444);
367MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 12e7677b834b..c94a0eb492cb 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -1117,16 +1117,6 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
1117 debugf0("%s(): mci\n", __func__); 1117 debugf0("%s(): mci\n", __func__);
1118 debugf0("Starting Probe1\n"); 1118 debugf0("Starting Probe1\n");
1119 1119
1120 /* make sure error reporting method is sane */
1121 switch (edac_op_state) {
1122 case EDAC_OPSTATE_POLL:
1123 case EDAC_OPSTATE_NMI:
1124 break;
1125 default:
1126 edac_op_state = EDAC_OPSTATE_POLL;
1127 break;
1128 }
1129
1130 /* check to see if device 0 function 1 is enabled; if it isn't, we 1120 /* check to see if device 0 function 1 is enabled; if it isn't, we
1131 * assume the BIOS has reserved it for a reason and is expecting 1121 * assume the BIOS has reserved it for a reason and is expecting
1132 * exclusive access, we take care not to violate that assumption and 1122 * exclusive access, we take care not to violate that assumption and
@@ -1303,6 +1293,10 @@ static int __init e752x_init(void)
1303 int pci_rc; 1293 int pci_rc;
1304 1294
1305 debugf3("%s()\n", __func__); 1295 debugf3("%s()\n", __func__);
1296
1297 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
1298 opstate_init();
1299
1306 pci_rc = pci_register_driver(&e752x_driver); 1300 pci_rc = pci_register_driver(&e752x_driver);
1307 return (pci_rc < 0) ? pci_rc : 0; 1301 return (pci_rc < 0) ? pci_rc : 0;
1308} 1302}
@@ -1323,6 +1317,7 @@ MODULE_DESCRIPTION("MC support for Intel e752x/3100 memory controllers");
1323module_param(force_function_unhide, int, 0444); 1317module_param(force_function_unhide, int, 0444);
1324MODULE_PARM_DESC(force_function_unhide, "if BIOS sets Dev0:Fun1 up as hidden:" 1318MODULE_PARM_DESC(force_function_unhide, "if BIOS sets Dev0:Fun1 up as hidden:"
1325 " 1=force unhide and hope BIOS doesn't fight driver for Dev0:Fun1 access"); 1319 " 1=force unhide and hope BIOS doesn't fight driver for Dev0:Fun1 access");
1320
1326module_param(edac_op_state, int, 0444); 1321module_param(edac_op_state, int, 0444);
1327MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); 1322MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
1328 1323
diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c
index 96ecc4926641..c7d11cc4e21a 100644
--- a/drivers/edac/e7xxx_edac.c
+++ b/drivers/edac/e7xxx_edac.c
@@ -414,16 +414,6 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
414 414
415 debugf0("%s(): mci\n", __func__); 415 debugf0("%s(): mci\n", __func__);
416 416
417 /* make sure error reporting method is sane */
418 switch (edac_op_state) {
419 case EDAC_OPSTATE_POLL:
420 case EDAC_OPSTATE_NMI:
421 break;
422 default:
423 edac_op_state = EDAC_OPSTATE_POLL;
424 break;
425 }
426
427 pci_read_config_dword(pdev, E7XXX_DRC, &drc); 417 pci_read_config_dword(pdev, E7XXX_DRC, &drc);
428 418
429 drc_chan = dual_channel_active(drc, dev_idx); 419 drc_chan = dual_channel_active(drc, dev_idx);
@@ -565,6 +555,9 @@ static struct pci_driver e7xxx_driver = {
565 555
566static int __init e7xxx_init(void) 556static int __init e7xxx_init(void)
567{ 557{
558 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
559 opstate_init();
560
568 return pci_register_driver(&e7xxx_driver); 561 return pci_register_driver(&e7xxx_driver);
569} 562}
570 563
diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c
index 5d4292811c14..6c9a0f2a593c 100644
--- a/drivers/edac/i3000_edac.c
+++ b/drivers/edac/i3000_edac.c
@@ -326,15 +326,6 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx)
326 return -ENODEV; 326 return -ENODEV;
327 } 327 }
328 328
329 switch (edac_op_state) {
330 case EDAC_OPSTATE_POLL:
331 case EDAC_OPSTATE_NMI:
332 break;
333 default:
334 edac_op_state = EDAC_OPSTATE_POLL;
335 break;
336 }
337
338 c0dra[0] = readb(window + I3000_C0DRA + 0); /* ranks 0,1 */ 329 c0dra[0] = readb(window + I3000_C0DRA + 0); /* ranks 0,1 */
339 c0dra[1] = readb(window + I3000_C0DRA + 1); /* ranks 2,3 */ 330 c0dra[1] = readb(window + I3000_C0DRA + 1); /* ranks 2,3 */
340 c1dra[0] = readb(window + I3000_C1DRA + 0); /* ranks 0,1 */ 331 c1dra[0] = readb(window + I3000_C1DRA + 0); /* ranks 0,1 */
@@ -503,6 +494,10 @@ static int __init i3000_init(void)
503 int pci_rc; 494 int pci_rc;
504 495
505 debugf3("MC: %s()\n", __func__); 496 debugf3("MC: %s()\n", __func__);
497
498 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
499 opstate_init();
500
506 pci_rc = pci_register_driver(&i3000_driver); 501 pci_rc = pci_register_driver(&i3000_driver);
507 if (pci_rc < 0) 502 if (pci_rc < 0)
508 goto fail0; 503 goto fail0;
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c
index 5a852017c17a..4a16b5b61cfb 100644
--- a/drivers/edac/i5000_edac.c
+++ b/drivers/edac/i5000_edac.c
@@ -1286,16 +1286,6 @@ static int i5000_probe1(struct pci_dev *pdev, int dev_idx)
1286 if (PCI_FUNC(pdev->devfn) != 0) 1286 if (PCI_FUNC(pdev->devfn) != 0)
1287 return -ENODEV; 1287 return -ENODEV;
1288 1288
1289 /* make sure error reporting method is sane */
1290 switch (edac_op_state) {
1291 case EDAC_OPSTATE_POLL:
1292 case EDAC_OPSTATE_NMI:
1293 break;
1294 default:
1295 edac_op_state = EDAC_OPSTATE_POLL;
1296 break;
1297 }
1298
1299 /* Ask the devices for the number of CSROWS and CHANNELS so 1289 /* Ask the devices for the number of CSROWS and CHANNELS so
1300 * that we can calculate the memory resources, etc 1290 * that we can calculate the memory resources, etc
1301 * 1291 *
@@ -1478,6 +1468,9 @@ static int __init i5000_init(void)
1478 1468
1479 debugf2("MC: " __FILE__ ": %s()\n", __func__); 1469 debugf2("MC: " __FILE__ ": %s()\n", __func__);
1480 1470
1471 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
1472 opstate_init();
1473
1481 pci_rc = pci_register_driver(&i5000_driver); 1474 pci_rc = pci_register_driver(&i5000_driver);
1482 1475
1483 return (pci_rc < 0) ? pci_rc : 0; 1476 return (pci_rc < 0) ? pci_rc : 0;
@@ -1501,5 +1494,6 @@ MODULE_AUTHOR
1501 ("Linux Networx (http://lnxi.com) Doug Thompson <norsk5@xmission.com>"); 1494 ("Linux Networx (http://lnxi.com) Doug Thompson <norsk5@xmission.com>");
1502MODULE_DESCRIPTION("MC Driver for Intel I5000 memory controllers - " 1495MODULE_DESCRIPTION("MC Driver for Intel I5000 memory controllers - "
1503 I5000_REVISION); 1496 I5000_REVISION);
1497
1504module_param(edac_op_state, int, 0444); 1498module_param(edac_op_state, int, 0444);
1505MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); 1499MODULE_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 83bfe37c4bbb..c5305e3ee434 100644
--- a/drivers/edac/i82443bxgx_edac.c
+++ b/drivers/edac/i82443bxgx_edac.c
@@ -29,6 +29,7 @@
29 29
30#include <linux/slab.h> 30#include <linux/slab.h>
31 31
32#include <linux/edac.h>
32#include "edac_core.h" 33#include "edac_core.h"
33 34
34#define I82443_REVISION "0.1" 35#define I82443_REVISION "0.1"
@@ -386,6 +387,9 @@ static struct pci_driver i82443bxgx_edacmc_driver = {
386 387
387static int __init i82443bxgx_edacmc_init(void) 388static int __init i82443bxgx_edacmc_init(void)
388{ 389{
390 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
391 opstate_init();
392
389 return pci_register_driver(&i82443bxgx_edacmc_driver); 393 return pci_register_driver(&i82443bxgx_edacmc_driver);
390} 394}
391 395
@@ -400,3 +404,6 @@ module_exit(i82443bxgx_edacmc_exit);
400MODULE_LICENSE("GPL"); 404MODULE_LICENSE("GPL");
401MODULE_AUTHOR("Tim Small <tim@buttersideup.com> - WPAD"); 405MODULE_AUTHOR("Tim Small <tim@buttersideup.com> - WPAD");
402MODULE_DESCRIPTION("EDAC MC support for Intel 82443BX/GX memory controllers"); 406MODULE_DESCRIPTION("EDAC MC support for Intel 82443BX/GX memory controllers");
407
408module_param(edac_op_state, int, 0444);
409MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c
index f5ecd2c4d813..c0088ba9672b 100644
--- a/drivers/edac/i82860_edac.c
+++ b/drivers/edac/i82860_edac.c
@@ -14,6 +14,7 @@
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/pci_ids.h> 15#include <linux/pci_ids.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/edac.h>
17#include "edac_core.h" 18#include "edac_core.h"
18 19
19#define I82860_REVISION " Ver: 2.0.2 " __DATE__ 20#define I82860_REVISION " Ver: 2.0.2 " __DATE__
@@ -294,6 +295,9 @@ static int __init i82860_init(void)
294 295
295 debugf3("%s()\n", __func__); 296 debugf3("%s()\n", __func__);
296 297
298 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
299 opstate_init();
300
297 if ((pci_rc = pci_register_driver(&i82860_driver)) < 0) 301 if ((pci_rc = pci_register_driver(&i82860_driver)) < 0)
298 goto fail0; 302 goto fail0;
299 303
@@ -345,3 +349,6 @@ MODULE_LICENSE("GPL");
345MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com) " 349MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com) "
346 "Ben Woodard <woodard@redhat.com>"); 350 "Ben Woodard <woodard@redhat.com>");
347MODULE_DESCRIPTION("ECC support for Intel 82860 memory hub controllers"); 351MODULE_DESCRIPTION("ECC support for Intel 82860 memory hub controllers");
352
353module_param(edac_op_state, int, 0444);
354MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c
index 031abadc439a..e43bdc43a1bf 100644
--- a/drivers/edac/i82875p_edac.c
+++ b/drivers/edac/i82875p_edac.c
@@ -18,6 +18,7 @@
18#include <linux/pci.h> 18#include <linux/pci.h>
19#include <linux/pci_ids.h> 19#include <linux/pci_ids.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/edac.h>
21#include "edac_core.h" 22#include "edac_core.h"
22 23
23#define I82875P_REVISION " Ver: 2.0.2 " __DATE__ 24#define I82875P_REVISION " Ver: 2.0.2 " __DATE__
@@ -393,6 +394,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
393 struct i82875p_error_info discard; 394 struct i82875p_error_info discard;
394 395
395 debugf0("%s()\n", __func__); 396 debugf0("%s()\n", __func__);
397
396 ovrfl_pdev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL); 398 ovrfl_pdev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL);
397 399
398 if (i82875p_setup_overfl_dev(pdev, &ovrfl_pdev, &ovrfl_window)) 400 if (i82875p_setup_overfl_dev(pdev, &ovrfl_pdev, &ovrfl_window))
@@ -532,6 +534,10 @@ static int __init i82875p_init(void)
532 int pci_rc; 534 int pci_rc;
533 535
534 debugf3("%s()\n", __func__); 536 debugf3("%s()\n", __func__);
537
538 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
539 opstate_init();
540
535 pci_rc = pci_register_driver(&i82875p_driver); 541 pci_rc = pci_register_driver(&i82875p_driver);
536 542
537 if (pci_rc < 0) 543 if (pci_rc < 0)
@@ -586,3 +592,6 @@ module_exit(i82875p_exit);
586MODULE_LICENSE("GPL"); 592MODULE_LICENSE("GPL");
587MODULE_AUTHOR("Linux Networx (http://lnxi.com) Thayne Harbaugh"); 593MODULE_AUTHOR("Linux Networx (http://lnxi.com) Thayne Harbaugh");
588MODULE_DESCRIPTION("MC support for Intel 82875 memory hub controllers"); 594MODULE_DESCRIPTION("MC support for Intel 82875 memory hub controllers");
595
596module_param(edac_op_state, int, 0444);
597MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c
index 0ee888456932..2eed3ea2cf62 100644
--- a/drivers/edac/i82975x_edac.c
+++ b/drivers/edac/i82975x_edac.c
@@ -14,7 +14,7 @@
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/pci_ids.h> 15#include <linux/pci_ids.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17 17#include <linux/edac.h>
18#include "edac_core.h" 18#include "edac_core.h"
19 19
20#define I82975X_REVISION " Ver: 1.0.0 " __DATE__ 20#define I82975X_REVISION " Ver: 1.0.0 " __DATE__
@@ -611,6 +611,9 @@ static int __init i82975x_init(void)
611 611
612 debugf3("%s()\n", __func__); 612 debugf3("%s()\n", __func__);
613 613
614 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
615 opstate_init();
616
614 pci_rc = pci_register_driver(&i82975x_driver); 617 pci_rc = pci_register_driver(&i82975x_driver);
615 if (pci_rc < 0) 618 if (pci_rc < 0)
616 goto fail0; 619 goto fail0;
@@ -664,3 +667,6 @@ module_exit(i82975x_exit);
664MODULE_LICENSE("GPL"); 667MODULE_LICENSE("GPL");
665MODULE_AUTHOR("Arvind R. <arvind@acarlab.com>"); 668MODULE_AUTHOR("Arvind R. <arvind@acarlab.com>");
666MODULE_DESCRIPTION("MC support for Intel 82975 memory hub controllers"); 669MODULE_DESCRIPTION("MC support for Intel 82975 memory hub controllers");
670
671module_param(edac_op_state, int, 0444);
672MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
diff --git a/drivers/edac/pasemi_edac.c b/drivers/edac/pasemi_edac.c
index 90320917be28..3fd65a563848 100644
--- a/drivers/edac/pasemi_edac.c
+++ b/drivers/edac/pasemi_edac.c
@@ -284,6 +284,9 @@ static struct pci_driver pasemi_edac_driver = {
284 284
285static int __init pasemi_edac_init(void) 285static int __init pasemi_edac_init(void)
286{ 286{
287 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
288 opstate_init();
289
287 return pci_register_driver(&pasemi_edac_driver); 290 return pci_register_driver(&pasemi_edac_driver);
288} 291}
289 292
@@ -298,3 +301,6 @@ module_exit(pasemi_edac_exit);
298MODULE_LICENSE("GPL"); 301MODULE_LICENSE("GPL");
299MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>"); 302MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>");
300MODULE_DESCRIPTION("MC support for PA Semi PWRficient memory controller"); 303MODULE_DESCRIPTION("MC support for PA Semi PWRficient memory controller");
304module_param(edac_op_state, int, 0444);
305MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
306
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index e25f712f2dc3..9900675e9598 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -20,6 +20,7 @@
20#include <linux/pci.h> 20#include <linux/pci.h>
21#include <linux/pci_ids.h> 21#include <linux/pci_ids.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/edac.h>
23#include "edac_core.h" 24#include "edac_core.h"
24 25
25#define R82600_REVISION " Ver: 2.0.2 " __DATE__ 26#define R82600_REVISION " Ver: 2.0.2 " __DATE__
@@ -393,6 +394,9 @@ static struct pci_driver r82600_driver = {
393 394
394static int __init r82600_init(void) 395static int __init r82600_init(void)
395{ 396{
397 /* Ensure that the OPSTATE is set correctly for POLL or NMI */
398 opstate_init();
399
396 return pci_register_driver(&r82600_driver); 400 return pci_register_driver(&r82600_driver);
397} 401}
398 402
@@ -412,3 +416,6 @@ MODULE_DESCRIPTION("MC support for Radisys 82600 memory controllers");
412module_param(disable_hardware_scrub, bool, 0644); 416module_param(disable_hardware_scrub, bool, 0644);
413MODULE_PARM_DESC(disable_hardware_scrub, 417MODULE_PARM_DESC(disable_hardware_scrub,
414 "If set, disable the chipset's automatic scrub for CEs"); 418 "If set, disable the chipset's automatic scrub for CEs");
419
420module_param(edac_op_state, int, 0444);
421MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");