aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2009-10-13 18:16:50 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:00:13 -0500
commit9ca1d01f7aa035553501a34054ea17e7537eb07e (patch)
treeac2b18a8ff71b3c378f07a76eb92964da0ff2c8d /drivers
parentf3a0a77e8df2f5c78648ce5971176e610dbc35c0 (diff)
[SCSI] qla2xxx: Properly check FCP_RSP response-info field after TMF completion.
Original code discarded response-info field information and assumed the command completed successfully without verifying the target's status within the FCP_RSP packet. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index a10d41bf8f26..791f792a05ce 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -2318,6 +2318,7 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport,
2318{ 2318{
2319 int rval, rval2; 2319 int rval, rval2;
2320 struct tsk_mgmt_cmd *tsk; 2320 struct tsk_mgmt_cmd *tsk;
2321 struct sts_entry_24xx *sts;
2321 dma_addr_t tsk_dma; 2322 dma_addr_t tsk_dma;
2322 scsi_qla_host_t *vha; 2323 scsi_qla_host_t *vha;
2323 struct qla_hw_data *ha; 2324 struct qla_hw_data *ha;
@@ -2357,20 +2358,37 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport,
2357 sizeof(tsk->p.tsk.lun)); 2358 sizeof(tsk->p.tsk.lun));
2358 } 2359 }
2359 2360
2361 sts = &tsk->p.sts;
2360 rval = qla2x00_issue_iocb(vha, tsk, tsk_dma, 0); 2362 rval = qla2x00_issue_iocb(vha, tsk, tsk_dma, 0);
2361 if (rval != QLA_SUCCESS) { 2363 if (rval != QLA_SUCCESS) {
2362 DEBUG2_3_11(printk("%s(%ld): failed to issue %s Reset IOCB " 2364 DEBUG2_3_11(printk("%s(%ld): failed to issue %s Reset IOCB "
2363 "(%x).\n", __func__, vha->host_no, name, rval)); 2365 "(%x).\n", __func__, vha->host_no, name, rval));
2364 } else if (tsk->p.sts.entry_status != 0) { 2366 } else if (sts->entry_status != 0) {
2365 DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB " 2367 DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
2366 "-- error status (%x).\n", __func__, vha->host_no, 2368 "-- error status (%x).\n", __func__, vha->host_no,
2367 tsk->p.sts.entry_status)); 2369 sts->entry_status));
2368 rval = QLA_FUNCTION_FAILED; 2370 rval = QLA_FUNCTION_FAILED;
2369 } else if (tsk->p.sts.comp_status != 2371 } else if (sts->comp_status !=
2370 __constant_cpu_to_le16(CS_COMPLETE)) { 2372 __constant_cpu_to_le16(CS_COMPLETE)) {
2371 DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB " 2373 DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
2372 "-- completion status (%x).\n", __func__, 2374 "-- completion status (%x).\n", __func__,
2373 vha->host_no, le16_to_cpu(tsk->p.sts.comp_status))); 2375 vha->host_no, le16_to_cpu(sts->comp_status)));
2376 rval = QLA_FUNCTION_FAILED;
2377 } else if (!(le16_to_cpu(sts->scsi_status) &
2378 SS_RESPONSE_INFO_LEN_VALID)) {
2379 DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
2380 "-- no response info (%x).\n", __func__, vha->host_no,
2381 le16_to_cpu(sts->scsi_status)));
2382 rval = QLA_FUNCTION_FAILED;
2383 } else if (le32_to_cpu(sts->rsp_data_len) < 4) {
2384 DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
2385 "-- not enough response info (%d).\n", __func__,
2386 vha->host_no, le32_to_cpu(sts->rsp_data_len)));
2387 rval = QLA_FUNCTION_FAILED;
2388 } else if (sts->data[3]) {
2389 DEBUG2_3_11(printk("%s(%ld): failed to complete IOCB "
2390 "-- response (%x).\n", __func__,
2391 vha->host_no, sts->data[3]));
2374 rval = QLA_FUNCTION_FAILED; 2392 rval = QLA_FUNCTION_FAILED;
2375 } 2393 }
2376 2394