[PATCH 7/9] qla2xxx: convert to use fc helper and SCSI_MLQUEUE_TARGET_BUSY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/qla2xxx/qla_os.c |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 3c1b433..36f1d9e 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -379,11 +379,11 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
 		goto qc_fail_command;
 	}
 
-	rval = fc_remote_port_chkready(rport);
-	if (rval) {
-		cmd->result = rval;
+	rval = fc_remote_port_queue_ready(rport, cmd);
+	if (rval)
+		goto qc_busy;
+	if (cmd->result)
 		goto qc_fail_command;
-	}
 
 	/* Close window on fcport/rport state-transitioning. */
 	if (!*(fc_port_t **)rport->dd_data) {
@@ -397,7 +397,8 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
 			cmd->result = DID_NO_CONNECT << 16;
 			goto qc_fail_command;
 		}
-		goto qc_host_busy;
+		rval = SCSI_MLQUEUE_HOST_BUSY;
+		goto qc_busy;
 	}
 
 	spin_unlock_irq(ha->host->host_lock);
@@ -419,10 +420,11 @@ qc_host_busy_free_sp:
 	mempool_free(sp, ha->srb_mempool);
 
 qc_host_busy_lock:
+	rval = SCSI_MLQUEUE_HOST_BUSY;
 	spin_lock_irq(ha->host->host_lock);
 
-qc_host_busy:
-	return SCSI_MLQUEUE_HOST_BUSY;
+qc_busy:
+	return rval;
 
 qc_fail_command:
 	done(cmd);
@@ -446,11 +448,11 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
 		goto qc24_fail_command;
 	}
 
-	rval = fc_remote_port_chkready(rport);
-	if (rval) {
-		cmd->result = rval;
+	rval = fc_remote_port_queue_ready(rport, cmd);
+	if (rval)
+		goto qc24_busy;
+	if (cmd->result)
 		goto qc24_fail_command;
-	}
 
 	/* Close window on fcport/rport state-transitioning. */
 	if (!*(fc_port_t **)rport->dd_data) {
@@ -464,7 +466,8 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
 			cmd->result = DID_NO_CONNECT << 16;
 			goto qc24_fail_command;
 		}
-		goto qc24_host_busy;
+		rval = SCSI_MLQUEUE_HOST_BUSY;
+		goto qc24_busy;
 	}
 
 	spin_unlock_irq(ha->host->host_lock);
@@ -486,10 +489,11 @@ qc24_host_busy_free_sp:
 	mempool_free(sp, pha->srb_mempool);
 
 qc24_host_busy_lock:
+	rval = SCSI_MLQUEUE_HOST_BUSY;
 	spin_lock_irq(ha->host->host_lock);
 
-qc24_host_busy:
-	return SCSI_MLQUEUE_HOST_BUSY;
+qc24_busy:
+	return rval;
 
 qc24_fail_command:
 	done(cmd);
-- 
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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux