From: Mike Christie <michaelc@xxxxxxxxxxx> When transitioning to the blocked state use SCSI_ML_TARGET_BUSY instead of returning with DID_IMM_RETRY, because DID_IMM_RETRY causes a requeue and then possibly (if under recursion limits) a queuecommand call. Signed-off-by: Mike Christie <michaelc@xxxxxxxxxxx> --- drivers/scsi/lpfc/lpfc_scsi.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 70255c1..a7810f4 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -949,12 +949,11 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device)); int err; - err = fc_remote_port_chkready(rport); - if (err) { - cmnd->result = err; + err = fc_remote_port_queue_ready(rport, cmnd); + if (err) + goto out_busy; + if (cmnd->result) goto out_fail_command; - } - /* * Catch race where our node has transitioned, but the * transport is still transitioning. @@ -970,7 +969,8 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, "0707 driver's buffer pool is empty, " "IO busied\n"); - goto out_host_busy; + err = SCSI_MLQUEUE_HOST_BUSY; + goto out_busy; } /* @@ -1003,10 +1003,11 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) return 0; out_host_busy_free_buf: + err = SCSI_MLQUEUE_HOST_BUSY; lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd); lpfc_release_scsi_buf(phba, lpfc_cmd); - out_host_busy: - return SCSI_MLQUEUE_HOST_BUSY; + out_busy: + return err; out_fail_command: done(cmnd); -- 1.5.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html