Skip to contentSkip to conversation

EDAC: Balance PCI device enablement in three Intel drivers

PATCH In review Myeonghun Pak 3 participants 11 messages Sep 15 – Sep 16

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover EDAC: Balance PCI device enablement in three Intel drivers

These drivers leave PCI enable references held on probe failure or removal.

Use managed PCI enablement for e752x. Keep explicit cleanup for i3000 and x38 because their module initialization can invoke probe outside PCI driver binding. Each patch is independent.

These issues were identified during our ongoing static-analysis research while reviewing kernel code.

Assisted-by LLM

Myeonghun Pak (3):
EDAC/e752x: Use managed PCI device enablement
EDAC/i3000: Balance PCI device enablement
EDAC/x38: Balance PCI device enablement

 drivers/edac/e752x_edac.c | 2 +-
 drivers/edac/i3000_edac.c | 4 ++++
 drivers/edac/x38_edac.c   | 4 ++++
 3 files changed, 9 insertions(+), 1 deletion(-)
#1 lore raw

PATCH 1/3 EDAC/e752x: Use managed PCI device enablement

e752x_init_one() enables the PCI device without balancing the enable reference on probe failure or removal. Use pcim_enable_device() so the PCI device is disabled after failed probing and after driver removal.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 806c35f5057a ("[PATCH] EDAC: drivers for AMD 76x and Intel E750x, E752x")
Assisted-by LLM
---
 drivers/edac/e752x_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/e752x_edac.c +1 -1
@@ -1387,7 +1387,7 @@ static int e752x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	edac_dbg(0, "\n");
 
 	/* wake up and enable device */
-	if (pci_enable_device(pdev) < 0)
+	if (pcim_enable_device(pdev) < 0)
 		return -EIO;
 
 	return e752x_probe1(pdev, ent->driver_data);
maintainer
#2 lore raw

Re: [PATCH 1/3] EDAC/e752x: Use managed PCI device enablement

This one too?

If no objections, I'd orphan them all and stop taking patches for them.

Quoted 29 lines · Myeonghun Pak

e752x_init_one() enables the PCI device without balancing the enable reference on probe failure or removal. Use pcim_enable_device() so the PCI device is disabled after failed probing and after driver removal.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 806c35f5057a ("[PATCH] EDAC: drivers for AMD 76x and Intel E750x, E752x")
Assisted-by LLM
---
 drivers/edac/e752x_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/e752x_edac.c +1 -1
@@ -1387,7 +1387,7 @@ static int e752x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	edac_dbg(0, "\n");
 
 	/* wake up and enable device */
-	if (pci_enable_device(pdev) < 0)
+	if (pcim_enable_device(pdev) < 0)
 		return -EIO;
 
 	return e752x_probe1(pdev, ent->driver_data);
Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
maintainer
#3 lore raw

RE: [PATCH 1/3] EDAC/e752x: Use managed PCI device enablement

Quoted 3 lines

This one too?

If no objections, I'd orphan them all and stop taking patches for them.

Agreed. Even if someone is still using these old systems, they aren't going to be running v7.x kernels on them.

-Tony

maintainer
#4 lore raw

Re: [PATCH 1/3] EDAC/e752x: Use managed PCI device enablement

Quoted 2 lines · Tony

Agreed. Even if someone is still using these old systems, they aren't going to be running v7.x kernels on them.

Yeah, and it's not like we cannot resurrect those drivers. But for some of them we're simply keeping them in shape and considering how there's no feedback or anything else showing that at least someone is using them, we're simply wasting effort.

Lemme mark them as orphaned and queue them - we'll see who cries.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#5 lore raw

PATCH 2/3 EDAC/i3000: Balance PCI device enablement

In reply to Myeonghun Pak

i3000_init_one() leaves the PCI enable reference held when probing fails and when the controller is removed. Disable the device on probe failure and after removing the EDAC controller. Keep explicit cleanup because module initialization can call i3000_init_one() outside PCI driver binding.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 535c6a53035d ("drivers/edac: new inte 30x0 MC driver")
Assisted-by LLM
---
 drivers/edac/i3000_edac.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/edac/i3000_edac.c +4 -0
@@ -461,6 +461,8 @@ static int i3000_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return -EIO;
 
 	rc = i3000_probe1(pdev, ent->driver_data);
+	if (rc)
+		pci_disable_device(pdev);
 	if (!mci_pdev)
 		mci_pdev = pci_dev_get(pdev);
 
@@ -480,7 +482,9 @@ static void i3000_remove_one(struct pci_dev *pdev)
 	if (!mci)
 		return;
 
 	edac_mc_free(mci);
+
+	pci_disable_device(pdev);
 }
 
 static const struct pci_device_id i3000_pci_tbl[] = {
maintainer
#6 lore raw

Re: [PATCH 2/3] EDAC/i3000: Balance PCI device enablement

Tony,

I have recently started marking obsolete EDAC drivers as orphaned because, well, they don't deserve the effort.

How about this one?

Quoted 40 lines · Myeonghun Pak

i3000_init_one() leaves the PCI enable reference held when probing fails and when the controller is removed. Disable the device on probe failure and after removing the EDAC controller. Keep explicit cleanup because module initialization can call i3000_init_one() outside PCI driver binding.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 535c6a53035d ("drivers/edac: new inte 30x0 MC driver")
Assisted-by LLM
---
 drivers/edac/i3000_edac.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/edac/i3000_edac.c +4 -0
@@ -461,6 +461,8 @@ static int i3000_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return -EIO;
 
 	rc = i3000_probe1(pdev, ent->driver_data);
+	if (rc)
+		pci_disable_device(pdev);
 	if (!mci_pdev)
 		mci_pdev = pci_dev_get(pdev);
 
@@ -480,7 +482,9 @@ static void i3000_remove_one(struct pci_dev *pdev)
 	if (!mci)
 		return;
 
 	edac_mc_free(mci);
+
+	pci_disable_device(pdev);
 }
 
 static const struct pci_device_id i3000_pci_tbl[] = {
Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
maintainer
#7 lore raw

Re: [PATCH 2/3] EDAC/i3000: Balance PCI device enablement

Quoted 25 lines · Borislav Petkov

Tony,

I have recently started marking obsolete EDAC drivers as orphaned because, well, they don't deserve the effort.

How about this one?

Quoted 17 lines · Myeonghun Pak

i3000_init_one() leaves the PCI enable reference held when probing fails and when the controller is removed. Disable the device on probe failure and after removing the EDAC controller. Keep explicit cleanup because module initialization can call i3000_init_one() outside PCI driver binding.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 535c6a53035d ("drivers/edac: new inte 30x0 MC driver")
Assisted-by LLM
---
 drivers/edac/i3000_edac.c | 4 ++++
 1 file changed, 4 insertions(+)

Oh, that one is an orphan already:

./scripts/get_maintainer.pl -f drivers/edac/i3000_edac.c EDAC-I3000 status: Orphan

You can save your energy doing fixes for it.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#8 lore raw

PATCH 3/3 EDAC/x38: Balance PCI device enablement

In reply to Myeonghun Pak

x38_init_one() leaves the PCI enable reference held when probing fails and when the controller is removed. Disable the device on probe failure and after removing the EDAC controller. Keep explicit cleanup because module initialization can call x38_init_one() outside PCI driver binding.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes df8bc08c192f ("edac x38: new MC driver module")
Assisted-by LLM
---
 drivers/edac/x38_edac.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/edac/x38_edac.c +4 -0
@@ -423,6 +423,8 @@ static int x38_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return -EIO;
 
 	rc = x38_probe1(pdev, ent->driver_data);
+	if (rc)
+		pci_disable_device(pdev);
 	if (!mci_pdev)
 		mci_pdev = pci_dev_get(pdev);
 
@@ -439,9 +441,11 @@ static void x38_remove_one(struct pci_dev *pdev)
 	if (!mci)
 		return;
 
 	iounmap(mci->pvt_info);
 
 	edac_mc_free(mci);
+
+	pci_disable_device(pdev);
 }
 
 static const struct pci_device_id x38_pci_tbl[] = {
maintainer
#9 lore raw

Re: [PATCH 3/3] EDAC/x38: Balance PCI device enablement

This one looks old too.

Quoted 43 lines · Myeonghun Pak

x38_init_one() leaves the PCI enable reference held when probing fails and when the controller is removed. Disable the device on probe failure and after removing the EDAC controller. Keep explicit cleanup because module initialization can call x38_init_one() outside PCI driver binding.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes df8bc08c192f ("edac x38: new MC driver module")
Assisted-by LLM
---
 drivers/edac/x38_edac.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/edac/x38_edac.c +4 -0
@@ -423,6 +423,8 @@ static int x38_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return -EIO;
 
 	rc = x38_probe1(pdev, ent->driver_data);
+	if (rc)
+		pci_disable_device(pdev);
 	if (!mci_pdev)
 		mci_pdev = pci_dev_get(pdev);
 
@@ -439,9 +441,11 @@ static void x38_remove_one(struct pci_dev *pdev)
 	if (!mci)
 		return;
 
 	iounmap(mci->pvt_info);
 
 	edac_mc_free(mci);
+
+	pci_disable_device(pdev);
 }
 
 static const struct pci_device_id x38_pci_tbl[] = {
Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
maintainer
#10 lore raw

PATCH 1/1 MAINTAINERS: Orphan drivers/edac/x38_edac.c

From: "Borislav Petkov (AMD)" <[email protected]>
Date: Wed, 16 Sep 2026 12:25:37 -0700

This driver has been receiving odd fixes and API adjustments without anyone actually using it, TTBOMK. So orphan it.

---
 MAINTAINERS | 5 +++++
 1 file changed, 5 insertions(+)
MAINTAINERS +5 -0
index 4f57a3234fb8..9497c4e5b1f9 100644
@@ -9546,6 +9546,11 @@ L:	[email protected]
 S:	Odd Fixes
 F:	drivers/edac/ti_edac.c
 
+EDAC-X38
+L:	[email protected]
+S:	Orphan
+F:	drivers/edac/x38_edac.c
+
 EDIROL UA-101/UA-1000 DRIVER
 M:	Clemens Ladisch <[email protected]>
 L:	[email protected]
Signature · 8 lines
2.53.0


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette