lkml.org 
[lkml]   [2007]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/5] SCSI/initio PCI DMA fix

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 <jeff@garzik.org>

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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-05-27 16:57    [W:0.083 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site