[PATCH] iteraid: pci_enable_device() for IRQ routing

DORMANTno replies

From: Bjorn Helgaas <hidden>
Date: 2004-08-13 15:53:18
Also in: lkml

iteraid: add pci_enable_device() and fix IRQ truncation.

Thanks to Paul Blazejowski for reporting a boot-time panic and verifying
that this patch fixes it.

Signed-off-by: Bjorn Helgaas <redacted>
--- 2.6.8-rc4-mm1/drivers/scsi/iteraid.h.orig	2004-08-12 16:50:38.483419878 -0600
+++ 2.6.8-rc4-mm1/drivers/scsi/iteraid.h	2004-08-12 17:16:08.569338635 -0600
@@ -1203,8 +1203,8 @@
 typedef struct _Adapter {
 	char *name;		/* Adapter's name               */
 	u8 num_channels;	/* How many channels support    */
-	u8 irq;			/* irq number                   */
-	u8 irqOwned;		/* If any irq is use            */
+	unsigned int irq;	/* irq number                   */
+	unsigned int irqOwned;	/* If any irq is use            */
 	u8 pci_bus;		/* PCI bus number               */
 	u8 devfn;		/* Device and function number   */
 	u8 offline;		/* On line or off line          */
--- 2.6.8-rc4-mm1/drivers/scsi/iteraid.c.orig	2004-08-12 16:43:38.700221895 -0600
+++ 2.6.8-rc4-mm1/drivers/scsi/iteraid.c	2004-08-13 09:44:47.057869796 -0600
@@ -4901,12 +4901,16 @@
 		if (PCI_FUNC(pPciDev->devfn))
 			continue;
 
+		if (pci_enable_device(pPciDev))
+			continue;
+
 		/*
 		 * Allocate memory for Adapter.
 		 */
 		pAdap = (PITE_ADAPTER) kmalloc(sizeof(ITE_ADAPTER), GFP_ATOMIC);
 		if (pAdap == NULL) {
 			printk("iteraid_detect: pAdap allocate failed.\n");
+			pci_disable_device(pPciDev);
 			continue;
 		}
 		memset(pAdap, 0, sizeof(ITE_ADAPTER));
@@ -5016,6 +5020,7 @@
 		if (pAdap->IDEChannel != NULL) {
 			kfree(pAdap->IDEChannel);
 		}
+		pci_disable_device(pAdap->pci_dev);
 		if (pAdap != NULL) {
 			kfree(pAdap);
 		}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help