Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756726AbXE0OyO (ORCPT ); Sun, 27 May 2007 10:54:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753307AbXE0Ox6 (ORCPT ); Sun, 27 May 2007 10:53:58 -0400 Received: from havoc.gtf.org ([69.61.125.42]:33553 "EHLO havoc.gtf.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752799AbXE0Ox5 (ORCPT ); Sun, 27 May 2007 10:53:57 -0400 Date: Sun, 27 May 2007 10:53:57 -0400 From: Jeff Garzik To: Andrew Morton , linux-scsi@vger.kernel.org Cc: LKML Subject: [PATCH 1/5] SCSI/initio PCI DMA fix Message-ID: <20070527145357.GA17085@havoc.gtf.org> References: <20070527145200.GA17017@havoc.gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070527145200.GA17017@havoc.gtf.org> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2335 Lines: 66 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 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/