Commit f5e3e40b authored by Madhuranath Iyengar's avatar Madhuranath Iyengar Committed by James Bottomley

[SCSI] qla2xxx: Remove host_lock in queuecommand function

Also in qla_os.c, rename the function, remove DEF_SCSI_QCMD, etc.
Signed-off-by: default avatarMadhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 038d9446
...@@ -506,7 +506,7 @@ qla24xx_fw_version_str(struct scsi_qla_host *vha, char *str) ...@@ -506,7 +506,7 @@ qla24xx_fw_version_str(struct scsi_qla_host *vha, char *str)
static inline srb_t * static inline srb_t *
qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport, qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport,
struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) struct scsi_cmnd *cmd)
{ {
srb_t *sp; srb_t *sp;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
...@@ -520,14 +520,13 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport, ...@@ -520,14 +520,13 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport,
sp->cmd = cmd; sp->cmd = cmd;
sp->flags = 0; sp->flags = 0;
CMD_SP(cmd) = (void *)sp; CMD_SP(cmd) = (void *)sp;
cmd->scsi_done = done;
sp->ctx = NULL; sp->ctx = NULL;
return sp; return sp;
} }
static int static int
qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *vha = shost_priv(cmd->device->host); scsi_qla_host_t *vha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
...@@ -537,7 +536,6 @@ qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *) ...@@ -537,7 +536,6 @@ qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)
srb_t *sp; srb_t *sp;
int rval; int rval;
spin_unlock_irq(vha->host->host_lock);
if (ha->flags.eeh_busy) { if (ha->flags.eeh_busy) {
if (ha->flags.pci_channel_io_perm_failure) if (ha->flags.pci_channel_io_perm_failure)
cmd->result = DID_NO_CONNECT << 16; cmd->result = DID_NO_CONNECT << 16;
...@@ -570,40 +568,32 @@ qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *) ...@@ -570,40 +568,32 @@ qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)
goto qc24_target_busy; goto qc24_target_busy;
} }
sp = qla2x00_get_new_sp(base_vha, fcport, cmd, done); sp = qla2x00_get_new_sp(base_vha, fcport, cmd);
if (!sp) if (!sp)
goto qc24_host_busy_lock; goto qc24_host_busy;
rval = ha->isp_ops->start_scsi(sp); rval = ha->isp_ops->start_scsi(sp);
if (rval != QLA_SUCCESS) if (rval != QLA_SUCCESS)
goto qc24_host_busy_free_sp; goto qc24_host_busy_free_sp;
spin_lock_irq(vha->host->host_lock);
return 0; return 0;
qc24_host_busy_free_sp: qc24_host_busy_free_sp:
qla2x00_sp_free_dma(sp); qla2x00_sp_free_dma(sp);
mempool_free(sp, ha->srb_mempool); mempool_free(sp, ha->srb_mempool);
qc24_host_busy_lock: qc24_host_busy:
spin_lock_irq(vha->host->host_lock);
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
qc24_target_busy: qc24_target_busy:
spin_lock_irq(vha->host->host_lock);
return SCSI_MLQUEUE_TARGET_BUSY; return SCSI_MLQUEUE_TARGET_BUSY;
qc24_fail_command: qc24_fail_command:
spin_lock_irq(vha->host->host_lock); cmd->scsi_done(cmd);
done(cmd);
return 0; return 0;
} }
static DEF_SCSI_QCMD(qla2xxx_queuecommand)
/* /*
* qla2x00_eh_wait_on_command * qla2x00_eh_wait_on_command
* Waits for the command to be returned by the Firmware for some * Waits for the command to be returned by the Firmware for some
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment