aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorMadhuranath Iyengar <Madhu.Iyengar@qlogic.com>2011-02-23 18:27:06 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-25 12:21:52 -0500
commitf5e3e40b398d3593e26fcced987d4bd7b8f9e57a (patch)
treeb77d8852cfe3e50ccbddff722afebe73cf646450 /drivers/scsi/qla2xxx
parent038d9446a9e601d7972926ca69fee10eeda6f3c7 (diff)
[SCSI] qla2xxx: Remove host_lock in queuecommand function
Also in qla_os.c, rename the function, remove DEF_SCSI_QCMD, etc. Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index c194c23ca1fb..a37ac8b73e55 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -506,7 +506,7 @@ qla24xx_fw_version_str(struct scsi_qla_host *vha, char *str)
506 506
507static inline srb_t * 507static inline srb_t *
508qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport, 508qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport,
509 struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 509 struct scsi_cmnd *cmd)
510{ 510{
511 srb_t *sp; 511 srb_t *sp;
512 struct qla_hw_data *ha = vha->hw; 512 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 sp->cmd = cmd; 520 sp->cmd = cmd;
521 sp->flags = 0; 521 sp->flags = 0;
522 CMD_SP(cmd) = (void *)sp; 522 CMD_SP(cmd) = (void *)sp;
523 cmd->scsi_done = done;
524 sp->ctx = NULL; 523 sp->ctx = NULL;
525 524
526 return sp; 525 return sp;
527} 526}
528 527
529static int 528static int
530qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 529qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
531{ 530{
532 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 531 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
533 fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; 532 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 srb_t *sp; 536 srb_t *sp;
538 int rval; 537 int rval;
539 538
540 spin_unlock_irq(vha->host->host_lock);
541 if (ha->flags.eeh_busy) { 539 if (ha->flags.eeh_busy) {
542 if (ha->flags.pci_channel_io_perm_failure) 540 if (ha->flags.pci_channel_io_perm_failure)
543 cmd->result = DID_NO_CONNECT << 16; 541 cmd->result = DID_NO_CONNECT << 16;
@@ -570,40 +568,32 @@ qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)
570 goto qc24_target_busy; 568 goto qc24_target_busy;
571 } 569 }
572 570
573 sp = qla2x00_get_new_sp(base_vha, fcport, cmd, done); 571 sp = qla2x00_get_new_sp(base_vha, fcport, cmd);
574 if (!sp) 572 if (!sp)
575 goto qc24_host_busy_lock; 573 goto qc24_host_busy;
576 574
577 rval = ha->isp_ops->start_scsi(sp); 575 rval = ha->isp_ops->start_scsi(sp);
578 if (rval != QLA_SUCCESS) 576 if (rval != QLA_SUCCESS)
579 goto qc24_host_busy_free_sp; 577 goto qc24_host_busy_free_sp;
580 578
581 spin_lock_irq(vha->host->host_lock);
582
583 return 0; 579 return 0;
584 580
585qc24_host_busy_free_sp: 581qc24_host_busy_free_sp:
586 qla2x00_sp_free_dma(sp); 582 qla2x00_sp_free_dma(sp);
587 mempool_free(sp, ha->srb_mempool); 583 mempool_free(sp, ha->srb_mempool);
588 584
589qc24_host_busy_lock: 585qc24_host_busy:
590 spin_lock_irq(vha->host->host_lock);
591 return SCSI_MLQUEUE_HOST_BUSY; 586 return SCSI_MLQUEUE_HOST_BUSY;
592 587
593qc24_target_busy: 588qc24_target_busy:
594 spin_lock_irq(vha->host->host_lock);
595 return SCSI_MLQUEUE_TARGET_BUSY; 589 return SCSI_MLQUEUE_TARGET_BUSY;
596 590
597qc24_fail_command: 591qc24_fail_command:
598 spin_lock_irq(vha->host->host_lock); 592 cmd->scsi_done(cmd);
599 done(cmd);
600 593
601 return 0; 594 return 0;
602} 595}
603 596
604static DEF_SCSI_QCMD(qla2xxx_queuecommand)
605
606
607/* 597/*
608 * qla2x00_eh_wait_on_command 598 * qla2x00_eh_wait_on_command
609 * Waits for the command to be returned by the Firmware for some 599 * Waits for the command to be returned by the Firmware for some