]> err.no Git - linux-2.6/blobdiff - drivers/scsi/qla1280.c
[PATCH] Clean up struct flock64 definitions
[linux-2.6] / drivers / scsi / qla1280.c
index 4ad28081499085c859be8b32eec825217cd5d90b..b993652bfa25d3acaaa7332b3ade101a8bd9310f 100644 (file)
@@ -1098,7 +1098,13 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
 static int
 qla1280_eh_abort(struct scsi_cmnd * cmd)
 {
-       return qla1280_error_action(cmd, ABORT_COMMAND);
+       int rc;
+
+       spin_lock_irq(cmd->device->host->host_lock);
+       rc = qla1280_error_action(cmd, ABORT_COMMAND);
+       spin_unlock_irq(cmd->device->host->host_lock);
+
+       return rc;
 }
 
 /**************************************************************************
@@ -1108,7 +1114,13 @@ qla1280_eh_abort(struct scsi_cmnd * cmd)
 static int
 qla1280_eh_device_reset(struct scsi_cmnd *cmd)
 {
-       return qla1280_error_action(cmd, DEVICE_RESET);
+       int rc;
+
+       spin_lock_irq(cmd->device->host->host_lock);
+       rc = qla1280_error_action(cmd, DEVICE_RESET);
+       spin_unlock_irq(cmd->device->host->host_lock);
+
+       return rc;
 }
 
 /**************************************************************************
@@ -1118,7 +1130,13 @@ qla1280_eh_device_reset(struct scsi_cmnd *cmd)
 static int
 qla1280_eh_bus_reset(struct scsi_cmnd *cmd)
 {
-       return qla1280_error_action(cmd, BUS_RESET);
+       int rc;
+
+       spin_lock_irq(cmd->device->host->host_lock);
+       rc = qla1280_error_action(cmd, BUS_RESET);
+       spin_unlock_irq(cmd->device->host->host_lock);
+
+       return rc;
 }
 
 /**************************************************************************
@@ -1128,7 +1146,13 @@ qla1280_eh_bus_reset(struct scsi_cmnd *cmd)
 static int
 qla1280_eh_adapter_reset(struct scsi_cmnd *cmd)
 {
-       return qla1280_error_action(cmd, ADAPTER_RESET);
+       int rc;
+
+       spin_lock_irq(cmd->device->host->host_lock);
+       rc = qla1280_error_action(cmd, ADAPTER_RESET);
+       spin_unlock_irq(cmd->device->host->host_lock);
+
+       return rc;
 }
 
 static int
@@ -2829,7 +2853,7 @@ qla1280_bus_reset(struct scsi_qla_host *ha, int bus)
                ha->bus_settings[bus].failed_reset_count++;
        } else {
                spin_unlock_irq(HOST_LOCK);
-               schedule_timeout(reset_delay * HZ);
+               ssleep(reset_delay);
                spin_lock_irq(HOST_LOCK);
 
                ha->bus_settings[bus].scsi_bus_dead = 0;
@@ -4038,11 +4062,10 @@ qla1280_status_entry(struct scsi_qla_host *ha, struct response *pkt,
                        scsi_status, handle);
        }
 
-       /* Target busy */
-       if (scsi_status & SS_BUSY_CONDITION &&
-           scsi_status != SS_RESERVE_CONFLICT) {
-               CMD_RESULT(cmd) =
-                       DID_BUS_BUSY << 16 | (scsi_status & 0xff);
+       /* Target busy or queue full */
+       if ((scsi_status & 0xFF) == SAM_STAT_TASK_SET_FULL ||
+           (scsi_status & 0xFF) == SAM_STAT_BUSY) {
+               CMD_RESULT(cmd) = scsi_status & 0xff;
        } else {
 
                /* Save ISP completion status */