Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / scsi / imm.c
index a4e953b..fc0f30a 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/blkdev.h>
 #include <linux/parport.h>
 #include <linux/workqueue.h>
+#include <linux/delay.h>
 #include <asm/io.h>
 
 #include <scsi/scsi.h>
@@ -60,7 +61,7 @@ static inline imm_struct *imm_dev(struct Scsi_Host *host)
        return *(imm_struct **)&host->hostdata;
 }
 
-static spinlock_t arbitration_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(arbitration_lock);
 
 static void got_it(imm_struct *dev)
 {
@@ -610,9 +611,9 @@ static int imm_init(imm_struct *dev)
        if (imm_connect(dev, 0) != 1)
                return -EIO;
        imm_reset_pulse(dev->base);
-       udelay(1000);   /* Delay to allow devices to settle */
+       mdelay(1);      /* Delay to allow devices to settle */
        imm_disconnect(dev);
-       udelay(1000);   /* Another delay to allow devices to settle */
+       mdelay(1);      /* Another delay to allow devices to settle */
        return device_check(dev);
 }
 
@@ -758,7 +759,7 @@ static void imm_interrupt(void *data)
        case DID_OK:
                break;
        case DID_NO_CONNECT:
-               printk("imm: no device at SCSI ID %i\n", cmd->target);
+               printk("imm: no device at SCSI ID %i\n", cmd->device->id);
                break;
        case DID_BUS_BUSY:
                printk("imm: BUS BUSY - EPP timeout detected\n");
@@ -793,7 +794,7 @@ static void imm_interrupt(void *data)
        imm_pb_dismiss(dev);
 
        spin_lock_irqsave(host->host_lock, flags);
-       dev->cur_cmd = 0;
+       dev->cur_cmd = NULL;
        cmd->scsi_done(cmd);
        spin_unlock_irqrestore(host->host_lock, flags);
        return;
@@ -829,7 +830,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
 
                /* Phase 2 - We are now talking to the scsi bus */
        case 2:
-               if (!imm_select(dev, cmd->device->id)) {
+               if (!imm_select(dev, scmd_id(cmd))) {
                        imm_fail(dev, DID_NO_CONNECT);
                        return 0;
                }
@@ -1026,9 +1027,9 @@ static int imm_reset(struct scsi_cmnd *cmd)
 
        imm_connect(dev, CONNECT_NORMAL);
        imm_reset_pulse(dev->base);
-       udelay(1000);           /* device settle delay */
+       mdelay(1);              /* device settle delay */
        imm_disconnect(dev);
-       udelay(1000);           /* device settle delay */
+       mdelay(1);              /* device settle delay */
        return SUCCESS;
 }
 
@@ -1118,6 +1119,12 @@ static int device_check(imm_struct *dev)
        return -ENODEV;
 }
 
+static int imm_adjust_queue(struct scsi_device *device)
+{
+       blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH);
+       return 0;
+}
+
 static struct scsi_host_template imm_template = {
        .module                 = THIS_MODULE,
        .proc_name              = "imm",
@@ -1133,6 +1140,11 @@ static struct scsi_host_template imm_template = {
        .cmd_per_lun            = 1,
        .use_clustering         = ENABLE_CLUSTERING,
        .can_queue              = 1,
+       .slave_alloc            = imm_adjust_queue,
+       .unchecked_isa_dma      = 1, /* imm cannot deal with highmem, so
+                                     * this is an easy trick to ensure
+                                     * all io pages for this host reside
+                                     * in low memory */
 };
 
 /***************************************************************************