aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_isr.c
diff options
context:
space:
mode:
authorArmen Baloyan <armen.baloyan@qlogic.com>2014-02-26 04:15:17 -0500
committerJames Bottomley <JBottomley@Parallels.com>2014-03-15 13:18:52 -0400
commitfaef62d134631c1f390006d51d49c76033f9504f (patch)
tree6da279f1d08a7be4a7a1c0995b5d1a1f653a1e22 /drivers/scsi/qla2xxx/qla_isr.c
parent43a9c38bf3867f4626107e17255db8c6a4bb16fc (diff)
[SCSI] qla2xxx: Fix Task Management command asynchronous handling
- Fix interpreting the wrong IOCB type for task management functions in the response path. - Merge the task management function handling for various adapters. Signed-off-by: Armen Baloyan <armen.baloyan@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index c2aaf6a93cc1..293dbd565840 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1498,8 +1498,7 @@ logio_done:
1498} 1498}
1499 1499
1500static void 1500static void
1501qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, 1501qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
1502 struct tsk_mgmt_entry *tsk)
1503{ 1502{
1504 const char func[] = "TMF-IOCB"; 1503 const char func[] = "TMF-IOCB";
1505 const char *type; 1504 const char *type;
@@ -1507,7 +1506,6 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
1507 srb_t *sp; 1506 srb_t *sp;
1508 struct srb_iocb *iocb; 1507 struct srb_iocb *iocb;
1509 struct sts_entry_24xx *sts = (struct sts_entry_24xx *)tsk; 1508 struct sts_entry_24xx *sts = (struct sts_entry_24xx *)tsk;
1510 int error = 1;
1511 1509
1512 sp = qla2x00_get_sp_from_handle(vha, func, req, tsk); 1510 sp = qla2x00_get_sp_from_handle(vha, func, req, tsk);
1513 if (!sp) 1511 if (!sp)
@@ -1516,37 +1514,35 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
1516 iocb = &sp->u.iocb_cmd; 1514 iocb = &sp->u.iocb_cmd;
1517 type = sp->name; 1515 type = sp->name;
1518 fcport = sp->fcport; 1516 fcport = sp->fcport;
1517 iocb->u.tmf.data = QLA_SUCCESS;
1519 1518
1520 if (sts->entry_status) { 1519 if (sts->entry_status) {
1521 ql_log(ql_log_warn, fcport->vha, 0x5038, 1520 ql_log(ql_log_warn, fcport->vha, 0x5038,
1522 "Async-%s error - hdl=%x entry-status(%x).\n", 1521 "Async-%s error - hdl=%x entry-status(%x).\n",
1523 type, sp->handle, sts->entry_status); 1522 type, sp->handle, sts->entry_status);
1523 iocb->u.tmf.data = QLA_FUNCTION_FAILED;
1524 } else if (sts->comp_status != __constant_cpu_to_le16(CS_COMPLETE)) { 1524 } else if (sts->comp_status != __constant_cpu_to_le16(CS_COMPLETE)) {
1525 ql_log(ql_log_warn, fcport->vha, 0x5039, 1525 ql_log(ql_log_warn, fcport->vha, 0x5039,
1526 "Async-%s error - hdl=%x completion status(%x).\n", 1526 "Async-%s error - hdl=%x completion status(%x).\n",
1527 type, sp->handle, sts->comp_status); 1527 type, sp->handle, sts->comp_status);
1528 } else if (!(le16_to_cpu(sts->scsi_status) & 1528 iocb->u.tmf.data = QLA_FUNCTION_FAILED;
1529 } else if ((le16_to_cpu(sts->scsi_status) &
1529 SS_RESPONSE_INFO_LEN_VALID)) { 1530 SS_RESPONSE_INFO_LEN_VALID)) {
1530 ql_log(ql_log_warn, fcport->vha, 0x503a, 1531 if (le32_to_cpu(sts->rsp_data_len) < 4) {
1531 "Async-%s error - hdl=%x no response info(%x).\n", 1532 ql_log(ql_log_warn, fcport->vha, 0x503b,
1532 type, sp->handle, sts->scsi_status); 1533 "Async-%s error - hdl=%x not enough response(%d).\n",
1533 } else if (le32_to_cpu(sts->rsp_data_len) < 4) { 1534 type, sp->handle, sts->rsp_data_len);
1534 ql_log(ql_log_warn, fcport->vha, 0x503b, 1535 } else if (sts->data[3]) {
1535 "Async-%s error - hdl=%x not enough response(%d).\n", 1536 ql_log(ql_log_warn, fcport->vha, 0x503c,
1536 type, sp->handle, sts->rsp_data_len); 1537 "Async-%s error - hdl=%x response(%x).\n",
1537 } else if (sts->data[3]) { 1538 type, sp->handle, sts->data[3]);
1538 ql_log(ql_log_warn, fcport->vha, 0x503c, 1539 iocb->u.tmf.data = QLA_FUNCTION_FAILED;
1539 "Async-%s error - hdl=%x response(%x).\n", 1540 }
1540 type, sp->handle, sts->data[3]);
1541 } else {
1542 error = 0;
1543 } 1541 }
1544 1542
1545 if (error) { 1543 if (iocb->u.tmf.data != QLA_SUCCESS)
1546 iocb->u.tmf.data = error;
1547 ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5055, 1544 ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5055,
1548 (uint8_t *)sts, sizeof(*sts)); 1545 (uint8_t *)sts, sizeof(*sts));
1549 }
1550 1546
1551 sp->done(vha, sp, 0); 1547 sp->done(vha, sp, 0);
1552} 1548}
@@ -2026,6 +2022,12 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
2026 return; 2022 return;
2027 } 2023 }
2028 2024
2025 /* Task Management completion. */
2026 if (sp->type == SRB_TM_CMD) {
2027 qla24xx_tm_iocb_entry(vha, req, pkt);
2028 return;
2029 }
2030
2029 /* Fast path completion. */ 2031 /* Fast path completion. */
2030 if (comp_status == CS_COMPLETE && scsi_status == 0) { 2032 if (comp_status == CS_COMPLETE && scsi_status == 0) {
2031 qla2x00_process_completed_request(vha, req, handle); 2033 qla2x00_process_completed_request(vha, req, handle);
@@ -2475,10 +2477,6 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
2475 qla24xx_logio_entry(vha, rsp->req, 2477 qla24xx_logio_entry(vha, rsp->req,
2476 (struct logio_entry_24xx *)pkt); 2478 (struct logio_entry_24xx *)pkt);
2477 break; 2479 break;
2478 case TSK_MGMT_IOCB_TYPE:
2479 qla24xx_tm_iocb_entry(vha, rsp->req,
2480 (struct tsk_mgmt_entry *)pkt);
2481 break;
2482 case CT_IOCB_TYPE: 2480 case CT_IOCB_TYPE:
2483 qla24xx_els_ct_entry(vha, rsp->req, pkt, CT_IOCB_TYPE); 2481 qla24xx_els_ct_entry(vha, rsp->req, pkt, CT_IOCB_TYPE);
2484 break; 2482 break;