public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.15-git] i2o: Do not disable pci device when it's in use
@ 2005-12-18  2:39 Ben Collins
  0 siblings, 0 replies; only message in thread
From: Ben Collins @ 2005-12-18  2:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, akpm

When dpt_i2o is loaded first, i2o being loaded would cause it to call
pci_device_disable, thus breaking dpt_i2o's use of the device. Based on
similar usage of pci_disable_device in other drivers.
    
Signed-off-by: Ben Collins <bcollins@ubuntu.com>

diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c
index 81ef306..8859c8a 100644
--- a/drivers/message/i2o/pci.c
+++ b/drivers/message/i2o/pci.c
@@ -303,6 +303,7 @@ static int __devinit i2o_pci_probe(struc
 	struct i2o_controller *c;
 	int rc;
 	struct pci_dev *i960 = NULL;
+	int pci_dev_busy = 0;
 
 	printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n");
 
@@ -395,6 +396,8 @@ static int __devinit i2o_pci_probe(struc
 	if ((rc = i2o_pci_alloc(c))) {
 		printk(KERN_ERR "%s: DMA / IO allocation for I2O controller "
 		       " failed\n", c->name);
+		if (rc == -ENODEV)
+			pci_dev_busy = 1;
 		goto free_controller;
 	}
 
@@ -425,7 +428,8 @@ static int __devinit i2o_pci_probe(struc
 	i2o_iop_free(c);
 
       disable:
-	pci_disable_device(pdev);
+	if (!pci_dev_busy)
+		pci_disable_device(pdev);
 
 	return rc;
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2005-12-18  3:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-18  2:39 [PATCH 2.6.15-git] i2o: Do not disable pci device when it's in use Ben Collins

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