Skip to contentSkip to conversation

PCIe: portdrv: call pci_disable_device during remove

PATCH In review Alex Chiang 2 participants 2 messages Mar 8, 2009 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCIe: portdrv: call pci_disable_device during remove

The PCIe port driver calls pci_enable_device() during probe but never calls pci_disable_device() during remove.

---
This is a bug in the original PCIe port driver code, and should be backported to the .27 and .28 stable series.

The implementation of the PCIe port driver is different in linux-next, and I have a different patch for that.
---

drivers/pci/pcie/portdrv_pci.c +1 -0
index 248b4db..5ea566e 100644
@@ -103,6 +103,7 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
 static void pcie_portdrv_remove (struct pci_dev *dev)
 {
 	pcie_port_device_remove(dev);
+	pci_disable_device(dev);
 	kfree(pci_get_drvdata(dev));
 }
 
#1 lore raw
Quoted 11 lines · Alex Chiang

The PCIe port driver calls pci_enable_device() during probe but never calls pci_disable_device() during remove.

---
This is a bug in the original PCIe port driver code, and should be backported to the .27 and .28 stable series.

The implementation of the PCIe port driver is different in linux-next, and I have a different patch for that.

Fine with me.

drivers/pci/pcie/portdrv_pci.c static int __devinit pcie_portdrv_probe (struct pci_dev *dev, · line 108

Quoted 12 lines

---

drivers/pci/pcie/portdrv_pci.c +1 -0
index 248b4db..5ea566e 100644
@@ -103,6 +103,7 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
 static void pcie_portdrv_remove (struct pci_dev *dev)
 {
 	pcie_port_device_remove(dev);
+	pci_disable_device(dev);
 	kfree(pci_get_drvdata(dev));
 }

Thanks,
Rafael