summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorGiridhar Malavali <giridhar.malavali@qlogic.com>2010-10-15 22:27:49 +0400
committerJames Bottomley <James.Bottomley@suse.de>2010-10-26 01:04:12 +0400
commit38170fa8e66bb75fe806bdc91657732aef0eae90 (patch)
tree1130ec0eede771d40b82ffa58cd1216faae0ffaa /drivers/scsi/qla2xxx/qla_os.c
parent9dac0d9a93095ff5a27b975af30c25186bdcfeab (diff)
downloadlinux-38170fa8e66bb75fe806bdc91657732aef0eae90.tar.xz
[SCSI] qla2xxx: Avoid depending on SCSI host_lock in queuecommand function.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 02232deaf82d..1830e6e97315 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -545,6 +545,7 @@ qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
srb_t *sp;
int rval;
+ spin_unlock_irq(vha->host->host_lock);
if (ha->flags.eeh_busy) {
if (ha->flags.pci_channel_io_perm_failure)
cmd->result = DID_NO_CONNECT << 16;
@@ -559,10 +560,6 @@ qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
goto qc24_fail_command;
}
- /* Close window on fcport/rport state-transitioning. */
- if (fcport->drport)
- goto qc24_target_busy;
-
if (!vha->flags.difdix_supported &&
scsi_get_prot_op(cmd) != SCSI_PROT_NORMAL) {
DEBUG2(qla_printk(KERN_ERR, ha,
@@ -573,15 +570,14 @@ qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
}
if (atomic_read(&fcport->state) != FCS_ONLINE) {
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
- atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
+ atomic_read(&fcport->state) == FCS_DEVICE_LOST ||
+ atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
cmd->result = DID_NO_CONNECT << 16;
goto qc24_fail_command;
}
goto qc24_target_busy;
}
- spin_unlock_irq(vha->host->host_lock);
-
sp = qla2x00_get_new_sp(base_vha, fcport, cmd, done);
if (!sp)
goto qc24_host_busy_lock;
@@ -603,9 +599,11 @@ qc24_host_busy_lock:
return SCSI_MLQUEUE_HOST_BUSY;
qc24_target_busy:
+ spin_lock_irq(vha->host->host_lock);
return SCSI_MLQUEUE_TARGET_BUSY;
qc24_fail_command:
+ spin_lock_irq(vha->host->host_lock);
done(cmd);
return 0;
@@ -2613,12 +2611,12 @@ qla2x00_mark_all_devices_lost(scsi_qla_host_t *vha, int defer)
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD)
continue;
if (atomic_read(&fcport->state) == FCS_ONLINE) {
+ atomic_set(&fcport->state, FCS_DEVICE_LOST);
if (defer)
qla2x00_schedule_rport_del(vha, fcport, defer);
else if (vha->vp_idx == fcport->vp_idx)
qla2x00_schedule_rport_del(vha, fcport, defer);
}
- atomic_set(&fcport->state, FCS_DEVICE_LOST);
}
}