public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCIe: portdrv: call pci_disable_device during remove
@ 2009-03-08  4:46 Alex Chiang
  2009-03-09  0:29 ` Alex Chiang
  2009-03-09 21:28 ` Rafael J. Wysocki
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Chiang @ 2009-03-08  4:46 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-pci, linux-kernel

The PCIe port driver calls pci_enable_device when registering
ports, but never calls pci_disable_device during removal.

Signed-off-by: Alex Chiang <achiang@hp.com>
---
This patch is against jbarnes's linux-next branch.
---
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 5a5bfe7..e399825 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -473,6 +473,7 @@ void pcie_port_device_remove(struct pci_dev *dev)
 	struct pcie_port_data *port_data = pci_get_drvdata(dev);
 
 	device_for_each_child(&dev->dev, NULL, remove_iter);
+	pci_disable_device(dev);
 
 	switch (port_data->port_irq_mode) {
 	case PCIE_PORT_MSIX_MODE:

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] PCIe: portdrv: call pci_disable_device during remove
@ 2009-03-08  2:35 Alex Chiang
  2009-03-08 10:17 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Chiang @ 2009-03-08  2:35 UTC (permalink / raw)
  To: Jesse Barnes, rjw, matthew; +Cc: stable, linux-pci, linux-kernel

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

Cc: stable@kernel.org
Signed-off-by: Alex Chiang <achiang@hp.com>
---
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.
---
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 248b4db..5ea566e 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -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));
 }
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-09 21:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-08  4:46 [PATCH] PCIe: portdrv: call pci_disable_device during remove Alex Chiang
2009-03-09  0:29 ` Alex Chiang
2009-03-09 21:28 ` Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2009-03-08  2:35 Alex Chiang
2009-03-08 10:17 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox