From 99f1f534922a2f2251ba05b14657a1c62882a80e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 13 Dec 2007 16:14:05 -0800 Subject: [SCSI] initio: fix conflict when loading driver > I have a scanner connected to a Initio INI-950 SCSI card and I recently > upgraded from SuSE 10.2 to 10.3. The new kernel doesn't see any of my > devices. I get the following in /var/log/messages: > > ACPI: PCI Interrupt 0000:00:0a.0[A] -> GSI 17 (level, low) -> IRQ 16 > initio: I/O port range 0x0 is busy. > ACPI: PCI interrupt for device 0000:00:0a.0 disabled Humm not a collision - thats a bug in the driver updating. Looks like the changes I made and combined with Christoph's lost a line somewhere when I was merging it all. Signed-off-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- drivers/scsi/initio.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/scsi/initio.c') diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 4c4465d39a1..769a7a80585 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2867,6 +2867,7 @@ static int initio_probe_one(struct pci_dev *pdev, } host = (struct initio_host *)shost->hostdata; memset(host, 0, sizeof(struct initio_host)); + host->addr = pci_resource_start(pdev, 0); if (!request_region(host->addr, 256, "i91u")) { printk(KERN_WARNING "initio: I/O port range 0x%x is busy.\n", host->addr); -- cgit v1.2.3 From a169e63740779f62a9a5ddf0aa61091a393a03c5 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Mon, 17 Dec 2007 18:08:59 +0200 Subject: [SCSI] initio: bugfix for accessors patch patch: [SCSI] initio: convert to use the data buffer accessors had a small but fatal bug in that it didn't increment the pointer into the initio scatterlist descriptors as it looped over the block generated ones. Fixed here. Signed-off-by: Boaz Harrosh Signed-off-by: James Bottomley --- drivers/scsi/initio.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/scsi/initio.c') diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 769a7a80585..01bf0189367 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2616,6 +2616,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c scsi_for_each_sg(cmnd, sglist, cblk->sglen, i) { sg->data = cpu_to_le32((u32)sg_dma_address(sglist)); total_len += sg->len = cpu_to_le32((u32)sg_dma_len(sglist)); + ++sg; } cblk->buflen = (scsi_bufflen(cmnd) > total_len) ? -- cgit v1.2.3 From e2d435ea4084022ab88efa74214accb45b1f9e92 Mon Sep 17 00:00:00 2001 From: Stuart Swales Date: Wed, 23 Jan 2008 20:00:48 +0000 Subject: [SCSI] initio: fix module hangs on loading I've verified (on my Initio 9100 with a DAT drive) that the 2.6.24-rc8-git6 initio module still hangs on loading. These fixes (other than the printk) are needed to get the module to load ok (and work correctly) with my adapter & tape drive. a) printk cosmetic fix b) cblk->sglen needs setting for later DMA I/O routines to use c) host->bios_addr needs setting for debug output correctness d) semaph & semaph_lock initialisation had got lost since 2.6.22 e) since 2.6.22 the bios data address was truncated to 16 bits (needs 20 when shifted left) Signed-off-by: James Bottomley --- drivers/scsi/initio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/initio.c') diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 01bf0189367..a10a5c74b48 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -823,7 +823,7 @@ static void initio_append_busy_scb(struct initio_host * host, struct scsi_ctrl_b { #if DEBUG_QUEUE - printk("append busy SCB %o; ", scbp); + printk("append busy SCB %p; ", scbp); #endif if (scbp->tagmsg) host->act_tags[scbp->target]++; @@ -2609,6 +2609,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c cblk->bufptr = cpu_to_le32((u32)dma_addr); cmnd->SCp.dma_handle = dma_addr; + cblk->sglen = nseg; cblk->flags |= SCF_SG; /* Turn on SG list flag */ total_len = 0; @@ -2869,6 +2870,7 @@ static int initio_probe_one(struct pci_dev *pdev, host = (struct initio_host *)shost->hostdata; memset(host, 0, sizeof(struct initio_host)); host->addr = pci_resource_start(pdev, 0); + host->bios_addr = bios_seg; if (!request_region(host->addr, 256, "i91u")) { printk(KERN_WARNING "initio: I/O port range 0x%x is busy.\n", host->addr); @@ -2895,6 +2897,8 @@ static int initio_probe_one(struct pci_dev *pdev, host->pci_dev = pdev; + host->semaph = 1; + spin_lock_init(&host->semaph_lock); host->num_scbs = num_scb; host->scb = scb; host->next_pending = scb; @@ -2911,7 +2915,7 @@ static int initio_probe_one(struct pci_dev *pdev, host->last_avail = prev; spin_lock_init(&host->avail_lock); - initio_init(host, phys_to_virt(bios_seg << 4)); + initio_init(host, phys_to_virt(((u32)bios_seg << 4))); host->jsstatus0 = 0; -- cgit v1.2.3 From d3f46f39b7092594b498abc12f0c73b0b9913bde Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Tue, 15 Jan 2008 11:11:46 -0600 Subject: [SCSI] remove use_sg_chaining With the sg table code, every SCSI driver is now either chain capable or broken (or has sg_tablesize set so chaining is never activated), so there's no need to have a check in the host template. Also tidy up the code by moving the scatterlist size defines into the SCSI includes and permit the last entry of the scatterlist pools not to be a power of two. Signed-off-by: James Bottomley --- drivers/scsi/initio.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/scsi/initio.c') diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index a10a5c74b48..0cc8868ea35 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2833,7 +2833,6 @@ static struct scsi_host_template initio_template = { .sg_tablesize = SG_ALL, .cmd_per_lun = 1, .use_clustering = ENABLE_CLUSTERING, - .use_sg_chaining = ENABLE_SG_CHAINING, }; static int initio_probe_one(struct pci_dev *pdev, -- cgit v1.2.3