Skip to contentSkip to conversation

remove the broken i82443bxgx_edac driver

RFC PATCH In review Adrian Bunk 4 participants 6 messages Aug 31, 2008 – Sep 1, 2008 EDAC-core

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 remove the broken i82443bxgx_edac driver

The i82443bxgx_edac driver was added more than one year ago, but after only 3 seconds in Linus' tree it got a dependency on BROKEN with Andrew stating:

It will claim the PCI devices from under intel_agp.ko's feet. Greg is brewing some fix for that.

Since noone seems to care enough about this driver to get it working we can as well remove it.

---

 drivers/edac/Kconfig           |    8 
 drivers/edac/Makefile          |    1 
 drivers/edac/i82443bxgx_edac.c |  409 ---------------------------------
 3 files changed, 418 deletions(-)
drivers/edac/Kconfig +0 -8
index 5a11e3c..49ab1ed 100644
@@ -73,14 +73,6 @@ config EDAC_E752X
 	  Support for error detection and correction on the Intel
 	  E7520, E7525, E7320 server chipsets.
 
-config EDAC_I82443BXGX
-	tristate "Intel 82443BX/GX (440BX/GX)"
-	depends on EDAC_MM_EDAC && PCI && X86_32
-	depends on BROKEN
-	help
-	  Support for error detection and correction on the Intel
-	  82443BX/GX memory controllers (440BX/GX chipsets).
-
 config EDAC_I82875P
 	tristate "Intel 82875p (D82875P, E7210)"
 	depends on EDAC_MM_EDAC && PCI && X86_32
drivers/edac/Makefile +0 -1
index e5e9104..f06ceb4 100644
@@ -22,7 +22,6 @@ obj-$(CONFIG_EDAC_I5000)		+= i5000_edac.o
 obj-$(CONFIG_EDAC_I5100)		+= i5100_edac.o
 obj-$(CONFIG_EDAC_E7XXX)		+= e7xxx_edac.o
 obj-$(CONFIG_EDAC_E752X)		+= e752x_edac.o
-obj-$(CONFIG_EDAC_I82443BXGX)		+= i82443bxgx_edac.o
 obj-$(CONFIG_EDAC_I82875P)		+= i82875p_edac.o
 obj-$(CONFIG_EDAC_I82975X)		+= i82975x_edac.o
 obj-$(CONFIG_EDAC_I3000)		+= i3000_edac.o
drivers/edac/i82443bxgx_edac.c deleted +0 -409

409 lines not on this page · raw message

#1 lore raw
Quoted 9 lines · Adrian Bunk

The i82443bxgx_edac driver was added more than one year ago, but after only 3 seconds in Linus' tree it got a dependency on BROKEN with Andrew stating:

It will claim the PCI devices from under intel_agp.ko's feet. Greg is brewing some fix for that.

Since noone seems to care enough about this driver to get it working we can as well remove it.

This driver does work as long as it's not used concurrently with intel-agp, and I know of at least one user of it (who has been locally diking out the dependency on BROKEN).

#2 lore raw
Quoted 8 lines · Jason Uhlenkott
Quoted 7 lines · Adrian Bunk

The i82443bxgx_edac driver was added more than one year ago, but after only 3 seconds in Linus' tree it got a dependency on BROKEN with Andrew stating:

It will claim the PCI devices from under intel_agp.ko's feet. Greg is brewing some fix for that.

Quoted 6 lines
Quoted 2 lines

Since noone seems to care enough about this driver to get it working we can as well remove it.

This driver does work as long as it's not used concurrently with intel-agp, and I know of at least one user of it (who has been locally diking out the dependency on BROKEN).

With the dependency on BROKEN it might stay at having one user...

Is anyone going to fix it proerly?

Or should we work around the problem with a dependency on AGP_INTEL=n?

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 12 lines · Adrian Bunk
Quoted 11 lines · Jason Uhlenkott
Quoted 9 lines · Adrian Bunk

The i82443bxgx_edac driver was added more than one year ago, but after only 3 seconds in Linus' tree it got a dependency on BROKEN with Andrew stating:

It will claim the PCI devices from under intel_agp.ko's feet. Greg is brewing some fix for that.

Since noone seems to care enough about this driver to get it working we can as well remove it.

Quoted 7 lines
Quoted 3 lines

This driver does work as long as it's not used concurrently with intel-agp, and I know of at least one user of it (who has been locally diking out the dependency on BROKEN).

With the dependency on BROKEN it might stay at having one user...

Is anyone going to fix it proerly?

Yes, I have patches in my private tree to get multiple drivers to devices working. Unfortunatly they also currently cause the machine to crash in wierd ways, so they aren't quite there yet :)

I'll be working on them with other kernel developers in a week at a SuSE Labs conference so we should be able to pound something out pretty soon.

thanks,

greg k-h

#4 lore raw
In reply to Adrian Bunk
Quoted 10 lines · Adrian Bunk

The i82443bxgx_edac driver was added more than one year ago, but after only 3 seconds in Linus' tree it got a dependency on BROKEN with Andrew stating:

It will claim the PCI devices from under intel_agp.ko's feet. Greg is brewing some fix for that.

Since noone seems to care enough about this driver to get it working we can as well remove it.

Why not just make the same hack as in i3000_edac.c, i82860_edac.c, i82875p_edac.c and i82975x_edac.c?
I mean code around all occuriencies of 'mci_pdev'.
This hack still needs some polishing (at least for i82875p and i82975x), but it works for me (I have AGP stuff compiled into kernel). I attach 10-minutes copy-paste patch (completely untested, sorry, idea only).
I have 443gx just upgraded to 2.6 so I'll try to test it in next few days.

Best,
Vladislav

---

drivers/edac/i82443bxgx_edac.c 2008-09-01 00:14:45.000000000 +0300 renamed from drivers/edac/i82443bxgx_edac.c 2008-02-18 15:04:39.000000000 +0200 +60 -2
@@ -114,6 +114,12 @@ struct i82443bxgx_edacmc_error_info {
 
 static struct edac_pci_ctl_info *i82443bxgx_pci;
 
+static struct pci_dev *mci_pdev;       /* init dev: in case that AGP code has
+                                        * already registered driver
+                                        */
+
+static int 82443bxgx_registered = 1;
+
 static void i82443bxgx_edacmc_get_error_info(struct mem_ctl_info *mci,
                                struct i82443bxgx_edacmc_error_info
                                *info)
@@ -345,10 +351,17 @@ EXPORT_SYMBOL_GPL(i82443bxgx_edacmc_prob
 static int __devinit i82443bxgx_edacmc_init_one(struct pci_dev *pdev,
                                                const struct pci_device_id *ent)
 {
+       int rc;
+
        debugf0("MC: " __FILE__ ": %s()\n", __func__);
 
        /* don't need to call pci_device_enable() */
-       return i82443bxgx_edacmc_probe1(pdev, ent->driver_data);
+       rc = i82443bxgx_edacmc_probe1(pdev, ent->driver_data);
+
+       if (!mci_pdev)
+               mci_pdev = pci_dev_get(pdev);
+
+       return rc;
 }
 
 static void __devexit i82443bxgx_edacmc_remove_one(struct pci_dev *pdev)
@@ -390,12 +403,57 @@ static int __init i82443bxgx_edacmc_init
        /* Ensure that the OPSTATE is set correctly for POLL or NMI */
        opstate_init();
 
-       return pci_register_driver(&i82443bxgx_edacmc_driver);
+       pci_rc = pci_register_driver(&i82443bxgx_edacmc_driver);
+       if (pci_rc < 0)
+               goto fail0;
+
+       if (!mci_pdev) {
+               const struct pci_device_id *id = &i82443bxgx_pci_tbl[0];
+               int i = 0;
+               82443bxgx_registered = 0;
+
+               while (mci_pdev == NULL && id->vendor != 0) {
+                       mci_pdev = pci_get_device(id->vendor,
+                                       id->device, NULL);
+                       i++;
+                       id = &i82443bxgx_pci_tbl[i];
+               }
+               if (!mci_pdev) {
+                       debugf0("i82443bxgx pci_get_device fail\n");
+                       pci_rc = -ENODEV;
+                       goto fail1;
+               }
+
+               pci_rc = i82443bxgx_init_one(mci_pdev, i82443bxgx_pci_tbl);
+
+               if (pci_rc < 0) {
+                       debugf0("i82443bxgx init fail\n");
+                       pci_rc = -ENODEV;
+                       goto fail1;
+               }
+       }
+
+       return 0;
+
+fail1:
+       pci_unregister_driver(&i82975x_driver);
+
+fail0:
+       if (mci_pdev)
+               pci_dev_put(mci_pdev);
+
+       return pci_rc;
 }
 
 static void __exit i82443bxgx_edacmc_exit(void)
 {
        pci_unregister_driver(&i82443bxgx_edacmc_driver);
+
+       if (!i82443bxgx_registered)
+               i82443bxgx_remove_one(mci_pdev);
+
+       if (mci_pdev)
+               pci_dev_put(mci_pdev);
 }
 
 module_init(i82443bxgx_edacmc_init);
#5 lore raw

PATCH 1/1 Make i82443bxgx_edac coexist with intel_agp

In reply to Adrian Bunk

Hi all

Here is working patch for 443BX/GX MCH suppport in a EDAC. It makes i82443bxgx_edac coexist with intel_agp using the same approach as several other EDAC drivers.
Tested on Intel's L443GX with redhat's 2.6.18 with whole EDAC subsystem backported a while ago.

I'm not subscribed to lkml so please CC me in replies to that list.

[root@host ~]# dmesg|grep -iE '(AGP|EDAC)'
Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected an Intel 440GX Chipset.
agpgart: AGP aperture is 64M @ 0xf8000000
EDAC MC: Ver: 2.1.0 Jun 27 2008
EDAC MC0: Giving out device to 'i82443bxgx_edac' 'I82443BXGX': DEV 0000:00:00.0
EDAC PCI0: Giving out device to module 'i82443bxgx_edac' controller 'EDAC PCI controller': DEV '0000:00:00.0' (POLLED)

---

drivers/edac/i82443bxgx_edac.c +0 -0
@@ -114,6 +114,12 @@ struct i82443bxgx_edacmc_error_info {
 

static struct edac_pci_ctl_info *i82443bxgx_pci;

+static struct pci_dev *mci_pdev; /* init dev: in case that AGP code has
+ * already registered driver
+ */
+
+static int i82443bxgx_registered = 1;
+
static void i82443bxgx_edacmc_get_error_info(struct mem_ctl_info *mci,

				struct i82443bxgx_edacmc_error_info
				*info)

@@ -345,10 +351,17 @@ EXPORT_SYMBOL_GPL(i82443bxgx_edacmc_prob static int __devinit i82443bxgx_edacmc_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
+ int rc;
+

	debugf0("MC: " __FILE__ ": %s()\n", __func__);

	/* don't need to call pci_device_enable() */

- return i82443bxgx_edacmc_probe1(pdev, ent->driver_data);
+ rc = i82443bxgx_edacmc_probe1(pdev, ent->driver_data);
+
+ if (mci_pdev == NULL)
+ mci_pdev = pci_dev_get(pdev);
+
+ return rc;
}

static void __devexit i82443bxgx_edacmc_remove_one(struct pci_dev *pdev) @@ -387,15 +400,61 @@ static struct pci_driver i82443bxgx_edac

static int __init i82443bxgx_edacmc_init(void)
{

+	int pci_rc;
	/* Ensure that the OPSTATE is set correctly for POLL or NMI */
	opstate_init();

- return pci_register_driver(&i82443bxgx_edacmc_driver);
+ pci_rc = pci_register_driver(&i82443bxgx_edacmc_driver);
+ if (pci_rc < 0)
+ goto fail0;
+
+ if (mci_pdev == NULL) {
+ const struct pci_device_id *id = &i82443bxgx_pci_tbl[0];
+ int i = 0;
+ i82443bxgx_registered = 0;
+
+ while (mci_pdev == NULL && id->vendor != 0) {
+ mci_pdev = pci_get_device(id->vendor,
+ id->device, NULL);
+ i++;
+ id = &i82443bxgx_pci_tbl[i];
+ }
+ if (!mci_pdev) {
+ debugf0("i82443bxgx pci_get_device fail\n");
+ pci_rc = -ENODEV;
+ goto fail1;
+ }
+
+ pci_rc = i82443bxgx_edacmc_init_one(mci_pdev, i82443bxgx_pci_tbl);
+
+ if (pci_rc < 0) {
+ debugf0("i82443bxgx init fail\n");
+ pci_rc = -ENODEV;
+ goto fail1;
+ }
+ }
+
+ return 0;
+
+fail1:
+ pci_unregister_driver(&i82443bxgx_edacmc_driver);
+
+fail0:
+ if (mci_pdev != NULL)
+ pci_dev_put(mci_pdev);
+
+ return pci_rc;
}

static void __exit i82443bxgx_edacmc_exit(void)

{
	pci_unregister_driver(&i82443bxgx_edacmc_driver);

+
+ if (!i82443bxgx_registered)
+ i82443bxgx_edacmc_remove_one(mci_pdev);
+
+ if (mci_pdev)
+ pci_dev_put(mci_pdev);
}

module_init(i82443bxgx_edacmc_init);