merge by hand (fix up qla_os.c merge error)
[linux-2.6.git] / drivers / scsi / qla2xxx / qla_os.c
index f12a2b6fa7a06995de0a2a1dbeac71495981ed6d..e6831264f67ca87002b1b96151795035cebf1af6 100644 (file)
@@ -465,6 +465,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
        int ret, i;
        unsigned int id, lun;
        unsigned long serial;
+       unsigned long flags;
 
        if (!CMD_SP(cmd))
                return FAILED;
@@ -476,7 +477,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
        serial = cmd->serial_number;
 
        /* Check active list for command command. */
-       spin_lock(&ha->hardware_lock);
+       spin_lock_irqsave(&ha->hardware_lock, flags);
        for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) {
                sp = ha->outstanding_cmds[i];
 
@@ -491,7 +492,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
                    sp->state));
                DEBUG3(qla2x00_print_scsi_cmd(cmd);)
 
-               spin_unlock(&ha->hardware_lock);
+               spin_unlock_irqrestore(&ha->hardware_lock, flags);
                if (qla2x00_abort_command(ha, sp)) {
                        DEBUG2(printk("%s(%ld): abort_command "
                            "mbx failed.\n", __func__, ha->host_no));
@@ -500,20 +501,19 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
                            "mbx success.\n", __func__, ha->host_no));
                        ret = SUCCESS;
                }
-               spin_lock(&ha->hardware_lock);
+               spin_lock_irqsave(&ha->hardware_lock, flags);
 
                break;
        }
+       spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
        /* Wait for the command to be returned. */
        if (ret == SUCCESS) {
-               spin_unlock(&ha->hardware_lock);
                if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
                        qla_printk(KERN_ERR, ha, 
                            "scsi(%ld:%d:%d): Abort handler timed out -- %lx "
                            "%x.\n", ha->host_no, id, lun, serial, ret);
                }
-               spin_lock(&ha->hardware_lock);
        }
 
        qla_printk(KERN_INFO, ha, 
@@ -544,6 +544,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
        int     status;
        srb_t           *sp;
        struct scsi_cmnd *cmd;
+       unsigned long flags;
 
        status = 0;
 
@@ -552,11 +553,11 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
         * array
         */
        for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
-               spin_lock(&ha->hardware_lock);
+               spin_lock_irqsave(&ha->hardware_lock, flags);
                sp = ha->outstanding_cmds[cnt];
                if (sp) {
                        cmd = sp->cmd;
-                       spin_unlock(&ha->hardware_lock);
+                       spin_unlock_irqrestore(&ha->hardware_lock, flags);
                        if (cmd->device->id == t) {
                                if (!qla2x00_eh_wait_on_command(ha, cmd)) {
                                        status = 1;
@@ -564,7 +565,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
                                }
                        }
                } else {
-                       spin_unlock(&ha->hardware_lock);
+                       spin_unlock_irqrestore(&ha->hardware_lock, flags);
                }
        }
        return (status);
@@ -690,6 +691,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
        int     status;
        srb_t           *sp;
        struct scsi_cmnd *cmd;
+       unsigned long flags;
 
        status = 1;
 
@@ -698,17 +700,17 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
         * array
         */
        for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
-               spin_lock(&ha->hardware_lock);
+               spin_lock_irqsave(&ha->hardware_lock, flags);
                sp = ha->outstanding_cmds[cnt];
                if (sp) {
                        cmd = sp->cmd;
-                       spin_unlock(&ha->hardware_lock);
+                       spin_unlock_irqrestore(&ha->hardware_lock, flags);
                        status = qla2x00_eh_wait_on_command(ha, cmd);
                        if (status == 0)
                                break;
                }
                else {
-                       spin_unlock(&ha->hardware_lock);
+                       spin_unlock_irqrestore(&ha->hardware_lock, flags);
                }
        }
        return (status);