[PATCH 1/5] SCSI/initio PCI DMA fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The 'pci_dev' member of HCS is referenced during PCI DMA, but never
actually assigned a value.  Let's give it a useful value.

Has this driver been broken since PCI DMA support was added in Oct 2003?

Signed-off-by: Jeff Garzik <[email protected]>

a5eec1873b5934de70c589ad0f4596f78c4d0dd3
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index 7e7635c..8951494 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -583,7 +583,8 @@ void tul_read_eeprom(WORD CurBase)
 }				/* read_eeprom */
 
 static int Addi91u_into_Adapter_table(WORD wBIOS, WORD wBASE, BYTE bInterrupt,
-				      BYTE bBus, BYTE bDevice)
+				      BYTE bBus, BYTE bDevice,
+				      struct pci_dev *pci_dev)
 {
 	int i, j;
 
@@ -609,6 +610,7 @@ static int Addi91u_into_Adapter_table(WORD wBIOS, WORD wBASE, BYTE bInterrupt,
 		i91u_adpt[i].ADPT_BIOS = wBIOS;
 		i91u_adpt[i].ADPT_Bus = bBus;
 		i91u_adpt[i].ADPT_Device = bDevice;
+		i91u_adpt[i].pci_dev = pci_dev;
 		return 0;
 	}
 	return 1;
@@ -642,6 +644,7 @@ static void tul_stop_bm(HCS * pCurHcb)
 /***************************************************************************/
 static void get_tulipPCIConfig(HCS * pCurHcb, int ch_idx)
 {
+	pCurHcb->pci_dev = i91u_adpt[ch_idx].pci_dev;
 	pCurHcb->HCS_Base = i91u_adpt[ch_idx].ADPT_BASE;	/* Supply base address  */
 	pCurHcb->HCS_BIOS = i91u_adpt[ch_idx].ADPT_BIOS;	/* Supply BIOS address  */
 	pCurHcb->HCS_Intr = i91u_adpt[ch_idx].ADPT_INTR;	/* Supply interrupt line */
@@ -2789,7 +2792,8 @@ static int tul_NewReturnNumberOfAdapters(void)
 							(pDev->resource[0].start),
 						       	pDev->irq,
 						       	pDev->bus->number,
-					       		(pDev->devfn >> 3)
+					       		(pDev->devfn >> 3),
+							pDev
 		    		) == 0)
 				iAdapters++;
 		}
diff --git a/drivers/scsi/initio.h b/drivers/scsi/initio.h
index acb67a4..dcd42e2 100644
--- a/drivers/scsi/initio.h
+++ b/drivers/scsi/initio.h
@@ -529,6 +529,7 @@ typedef struct I91u_Adpt_Struc {
 	UBYTE ADPT_Bus;		/* 2 */
 	UBYTE ADPT_Device;	/* 3 */
 	UBYTE ADPT_INTR;	/* 4 */
+	struct pci_dev *pci_dev;
 } INI_ADPT_STRUCT;
 
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux