aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/initio.c
diff options
context:
space:
mode:
authorStuart Swales <stuart.swales@croftnuisk.co.uk>2008-01-23 15:00:48 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 18:07:33 -0500
commite2d435ea4084022ab88efa74214accb45b1f9e92 (patch)
treeef18af8bb62b684041ab55f5346c8051fe7bd637 /drivers/scsi/initio.c
parent8f7b3d156d348b6766833cd4e272d0d19b501e64 (diff)
[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 <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/initio.c')
-rw-r--r--drivers/scsi/initio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index 01bf0189367d..a10a5c74b48d 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
823{ 823{
824 824
825#if DEBUG_QUEUE 825#if DEBUG_QUEUE
826 printk("append busy SCB %o; ", scbp); 826 printk("append busy SCB %p; ", scbp);
827#endif 827#endif
828 if (scbp->tagmsg) 828 if (scbp->tagmsg)
829 host->act_tags[scbp->target]++; 829 host->act_tags[scbp->target]++;
@@ -2609,6 +2609,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
2609 cblk->bufptr = cpu_to_le32((u32)dma_addr); 2609 cblk->bufptr = cpu_to_le32((u32)dma_addr);
2610 cmnd->SCp.dma_handle = dma_addr; 2610 cmnd->SCp.dma_handle = dma_addr;
2611 2611
2612 cblk->sglen = nseg;
2612 2613
2613 cblk->flags |= SCF_SG; /* Turn on SG list flag */ 2614 cblk->flags |= SCF_SG; /* Turn on SG list flag */
2614 total_len = 0; 2615 total_len = 0;
@@ -2869,6 +2870,7 @@ static int initio_probe_one(struct pci_dev *pdev,
2869 host = (struct initio_host *)shost->hostdata; 2870 host = (struct initio_host *)shost->hostdata;
2870 memset(host, 0, sizeof(struct initio_host)); 2871 memset(host, 0, sizeof(struct initio_host));
2871 host->addr = pci_resource_start(pdev, 0); 2872 host->addr = pci_resource_start(pdev, 0);
2873 host->bios_addr = bios_seg;
2872 2874
2873 if (!request_region(host->addr, 256, "i91u")) { 2875 if (!request_region(host->addr, 256, "i91u")) {
2874 printk(KERN_WARNING "initio: I/O port range 0x%x is busy.\n", host->addr); 2876 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,
2895 2897
2896 host->pci_dev = pdev; 2898 host->pci_dev = pdev;
2897 2899
2900 host->semaph = 1;
2901 spin_lock_init(&host->semaph_lock);
2898 host->num_scbs = num_scb; 2902 host->num_scbs = num_scb;
2899 host->scb = scb; 2903 host->scb = scb;
2900 host->next_pending = scb; 2904 host->next_pending = scb;
@@ -2911,7 +2915,7 @@ static int initio_probe_one(struct pci_dev *pdev,
2911 host->last_avail = prev; 2915 host->last_avail = prev;
2912 spin_lock_init(&host->avail_lock); 2916 spin_lock_init(&host->avail_lock);
2913 2917
2914 initio_init(host, phys_to_virt(bios_seg << 4)); 2918 initio_init(host, phys_to_virt(((u32)bios_seg << 4)));
2915 2919
2916 host->jsstatus0 = 0; 2920 host->jsstatus0 = 0;
2917 2921