diff options
author | Saurav Kashyap <saurav.kashyap@qlogic.com> | 2011-07-14 15:00:13 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-07-27 06:16:17 -0400 |
commit | 7c3df1320e5e875478775e78d01a09aee96b8abe (patch) | |
tree | 215326b999b3db03f4a2268a79c3848803daaf7d /drivers/scsi/qla2xxx/qla_iocb.c | |
parent | 3ce8866ceae87258cf66d1f7fd72abc918753cec (diff) |
[SCSI] qla2xxx: Code changes to support new dynamic logging infrastructure.
The code is changed to support the new dynamic logging infrastructure.
Following are the levels added.
Default is 0 - no logging. 0x40000000 - Module Init & Probe.
0x20000000 - Mailbox Cmnds. 0x10000000 - Device Discovery.
0x08000000 - IO tracing. 0x04000000 - DPC Thread.
0x02000000 - Async events. 0x01000000 - Timer routines.
0x00800000 - User space. 0x00400000 - Task Management.
0x00200000 - AER/EEH. 0x00100000 - Multi Q.
0x00080000 - P3P Specific. 0x00040000 - Virtual Port.
0x00020000 - Buffer Dump. 0x00010000 - Misc.
0x7fffffff - For enabling all logs, can be too many logs.
Setting ql2xextended_error_logging module parameter to any of the above
value, will enable the debug for that particular level.
Do LOGICAL OR of the value to enable more than one level.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 120 |
1 files changed, 53 insertions, 67 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 7bac3cd109d6..49d6906af886 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -150,7 +150,8 @@ qla24xx_configure_prot_mode(srb_t *sp, uint16_t *fw_prot_opts) | |||
150 | 150 | ||
151 | /* We only support T10 DIF right now */ | 151 | /* We only support T10 DIF right now */ |
152 | if (guard != SHOST_DIX_GUARD_CRC) { | 152 | if (guard != SHOST_DIX_GUARD_CRC) { |
153 | DEBUG2(printk(KERN_ERR "Unsupported guard: %d\n", guard)); | 153 | ql_dbg(ql_dbg_io, sp->fcport->vha, 0x3007, |
154 | "Unsupported guard: %d for cmd=%p.\n", guard, sp->cmd); | ||
154 | return 0; | 155 | return 0; |
155 | } | 156 | } |
156 | 157 | ||
@@ -343,9 +344,10 @@ qla2x00_start_scsi(srb_t *sp) | |||
343 | 344 | ||
344 | /* Send marker if required */ | 345 | /* Send marker if required */ |
345 | if (vha->marker_needed != 0) { | 346 | if (vha->marker_needed != 0) { |
346 | if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) | 347 | if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) != |
347 | != QLA_SUCCESS) | 348 | QLA_SUCCESS) { |
348 | return (QLA_FUNCTION_FAILED); | 349 | return (QLA_FUNCTION_FAILED); |
350 | } | ||
349 | vha->marker_needed = 0; | 351 | vha->marker_needed = 0; |
350 | } | 352 | } |
351 | 353 | ||
@@ -490,8 +492,8 @@ __qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, | |||
490 | mrk24 = NULL; | 492 | mrk24 = NULL; |
491 | mrk = (mrk_entry_t *)qla2x00_alloc_iocbs(vha, 0); | 493 | mrk = (mrk_entry_t *)qla2x00_alloc_iocbs(vha, 0); |
492 | if (mrk == NULL) { | 494 | if (mrk == NULL) { |
493 | DEBUG2_3(printk("%s(%ld): failed to allocate Marker IOCB.\n", | 495 | ql_log(ql_log_warn, base_vha, 0x3026, |
494 | __func__, base_vha->host_no)); | 496 | "Failed to allocate Marker IOCB.\n"); |
495 | 497 | ||
496 | return (QLA_FUNCTION_FAILED); | 498 | return (QLA_FUNCTION_FAILED); |
497 | } | 499 | } |
@@ -547,9 +549,10 @@ qla2x00_isp_cmd(struct scsi_qla_host *vha, struct req_que *req) | |||
547 | device_reg_t __iomem *reg = ISP_QUE_REG(ha, req->id); | 549 | device_reg_t __iomem *reg = ISP_QUE_REG(ha, req->id); |
548 | struct device_reg_2xxx __iomem *ioreg = &ha->iobase->isp; | 550 | struct device_reg_2xxx __iomem *ioreg = &ha->iobase->isp; |
549 | 551 | ||
550 | DEBUG5(printk("%s(): IOCB data:\n", __func__)); | 552 | ql_dbg(ql_dbg_io + ql_dbg_buffer, vha, 0x302d, |
551 | DEBUG5(qla2x00_dump_buffer( | 553 | "IOCB data:\n"); |
552 | (uint8_t *)req->ring_ptr, REQUEST_ENTRY_SIZE)); | 554 | ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x302e, |
555 | (uint8_t *)req->ring_ptr, REQUEST_ENTRY_SIZE); | ||
553 | 556 | ||
554 | /* Adjust ring index. */ | 557 | /* Adjust ring index. */ |
555 | req->ring_index++; | 558 | req->ring_index++; |
@@ -604,7 +607,7 @@ qla2x00_isp_cmd(struct scsi_qla_host *vha, struct req_que *req) | |||
604 | * Returns the number of IOCB entries needed to store @dsds. | 607 | * Returns the number of IOCB entries needed to store @dsds. |
605 | */ | 608 | */ |
606 | inline uint16_t | 609 | inline uint16_t |
607 | qla24xx_calc_iocbs(uint16_t dsds) | 610 | qla24xx_calc_iocbs(scsi_qla_host_t *vha, uint16_t dsds) |
608 | { | 611 | { |
609 | uint16_t iocbs; | 612 | uint16_t iocbs; |
610 | 613 | ||
@@ -614,8 +617,6 @@ qla24xx_calc_iocbs(uint16_t dsds) | |||
614 | if ((dsds - 1) % 5) | 617 | if ((dsds - 1) % 5) |
615 | iocbs++; | 618 | iocbs++; |
616 | } | 619 | } |
617 | DEBUG3(printk(KERN_DEBUG "%s(): Required PKT(s) = %d\n", | ||
618 | __func__, iocbs)); | ||
619 | return iocbs; | 620 | return iocbs; |
620 | } | 621 | } |
621 | 622 | ||
@@ -712,6 +713,7 @@ qla24xx_set_t10dif_tags(struct scsi_cmnd *cmd, struct fw_dif_context *pkt, | |||
712 | unsigned int protcnt) | 713 | unsigned int protcnt) |
713 | { | 714 | { |
714 | struct sd_dif_tuple *spt; | 715 | struct sd_dif_tuple *spt; |
716 | scsi_qla_host_t *vha = shost_priv(cmd->device->host); | ||
715 | unsigned char op = scsi_get_prot_op(cmd); | 717 | unsigned char op = scsi_get_prot_op(cmd); |
716 | 718 | ||
717 | switch (scsi_get_prot_type(cmd)) { | 719 | switch (scsi_get_prot_type(cmd)) { |
@@ -768,9 +770,9 @@ qla24xx_set_t10dif_tags(struct scsi_cmnd *cmd, struct fw_dif_context *pkt, | |||
768 | op == SCSI_PROT_WRITE_PASS)) { | 770 | op == SCSI_PROT_WRITE_PASS)) { |
769 | spt = page_address(sg_page(scsi_prot_sglist(cmd))) + | 771 | spt = page_address(sg_page(scsi_prot_sglist(cmd))) + |
770 | scsi_prot_sglist(cmd)[0].offset; | 772 | scsi_prot_sglist(cmd)[0].offset; |
771 | DEBUG18(printk(KERN_DEBUG | 773 | ql_dbg(ql_dbg_io, vha, 0x3008, |
772 | "%s(): LBA from user %p, lba = 0x%x\n", | 774 | "LBA from user %p, lba = 0x%x for cmd=%p.\n", |
773 | __func__, spt, (int)spt->ref_tag)); | 775 | spt, (int)spt->ref_tag, cmd); |
774 | pkt->ref_tag = swab32(spt->ref_tag); | 776 | pkt->ref_tag = swab32(spt->ref_tag); |
775 | pkt->app_tag_mask[0] = 0x0; | 777 | pkt->app_tag_mask[0] = 0x0; |
776 | pkt->app_tag_mask[1] = 0x0; | 778 | pkt->app_tag_mask[1] = 0x0; |
@@ -789,11 +791,11 @@ qla24xx_set_t10dif_tags(struct scsi_cmnd *cmd, struct fw_dif_context *pkt, | |||
789 | break; | 791 | break; |
790 | } | 792 | } |
791 | 793 | ||
792 | DEBUG18(printk(KERN_DEBUG | 794 | ql_dbg(ql_dbg_io, vha, 0x3009, |
793 | "%s(): Setting protection Tags: (BIG) ref tag = 0x%x," | 795 | "Setting protection Tags: (BIG) ref tag = 0x%x, app tag = 0x%x, " |
794 | " app tag = 0x%x, prot SG count %d , cmd lba 0x%x," | 796 | "prot SG count %d, cmd lba 0x%x, prot_type=%u cmd=%p.\n", |
795 | " prot_type=%u\n", __func__, pkt->ref_tag, pkt->app_tag, protcnt, | 797 | pkt->ref_tag, pkt->app_tag, protcnt, (int)scsi_get_lba(cmd), |
796 | (int)scsi_get_lba(cmd), scsi_get_prot_type(cmd))); | 798 | scsi_get_prot_type(cmd), cmd); |
797 | } | 799 | } |
798 | 800 | ||
799 | 801 | ||
@@ -809,6 +811,7 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd, | |||
809 | uint32_t *cur_dsd = dsd; | 811 | uint32_t *cur_dsd = dsd; |
810 | int i; | 812 | int i; |
811 | uint16_t used_dsds = tot_dsds; | 813 | uint16_t used_dsds = tot_dsds; |
814 | scsi_qla_host_t *vha = shost_priv(sp->cmd->device->host); | ||
812 | 815 | ||
813 | uint8_t *cp; | 816 | uint8_t *cp; |
814 | 817 | ||
@@ -853,9 +856,10 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd, | |||
853 | cur_dsd = (uint32_t *)next_dsd; | 856 | cur_dsd = (uint32_t *)next_dsd; |
854 | } | 857 | } |
855 | sle_dma = sg_dma_address(sg); | 858 | sle_dma = sg_dma_address(sg); |
856 | DEBUG18(printk("%s(): %p, sg entry %d - addr =0x%x 0x%x," | 859 | ql_dbg(ql_dbg_io, vha, 0x300a, |
857 | " len =%d\n", __func__ , cur_dsd, i, LSD(sle_dma), | 860 | "sg entry %d - addr=0x%x 0x%x, " "len=%d for cmd=%p.\n", |
858 | MSD(sle_dma), sg_dma_len(sg))); | 861 | cur_dsd, i, LSD(sle_dma), MSD(sle_dma), sg_dma_len(sg), |
862 | sp->cmd); | ||
859 | *cur_dsd++ = cpu_to_le32(LSD(sle_dma)); | 863 | *cur_dsd++ = cpu_to_le32(LSD(sle_dma)); |
860 | *cur_dsd++ = cpu_to_le32(MSD(sle_dma)); | 864 | *cur_dsd++ = cpu_to_le32(MSD(sle_dma)); |
861 | *cur_dsd++ = cpu_to_le32(sg_dma_len(sg)); | 865 | *cur_dsd++ = cpu_to_le32(sg_dma_len(sg)); |
@@ -863,8 +867,8 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd, | |||
863 | 867 | ||
864 | if (scsi_get_prot_op(sp->cmd) == SCSI_PROT_WRITE_PASS) { | 868 | if (scsi_get_prot_op(sp->cmd) == SCSI_PROT_WRITE_PASS) { |
865 | cp = page_address(sg_page(sg)) + sg->offset; | 869 | cp = page_address(sg_page(sg)) + sg->offset; |
866 | DEBUG18(printk("%s(): User Data buffer= %p:\n", | 870 | ql_dbg(ql_dbg_io, vha, 0x300b, |
867 | __func__ , cp)); | 871 | "User data buffer=%p for cmd=%p.\n", cp, sp->cmd); |
868 | } | 872 | } |
869 | } | 873 | } |
870 | /* Null termination */ | 874 | /* Null termination */ |
@@ -888,7 +892,7 @@ qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *ha, srb_t *sp, | |||
888 | struct scsi_cmnd *cmd; | 892 | struct scsi_cmnd *cmd; |
889 | uint32_t *cur_dsd = dsd; | 893 | uint32_t *cur_dsd = dsd; |
890 | uint16_t used_dsds = tot_dsds; | 894 | uint16_t used_dsds = tot_dsds; |
891 | 895 | scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev); | |
892 | uint8_t *cp; | 896 | uint8_t *cp; |
893 | 897 | ||
894 | 898 | ||
@@ -935,10 +939,11 @@ qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *ha, srb_t *sp, | |||
935 | } | 939 | } |
936 | sle_dma = sg_dma_address(sg); | 940 | sle_dma = sg_dma_address(sg); |
937 | if (scsi_get_prot_op(sp->cmd) == SCSI_PROT_WRITE_PASS) { | 941 | if (scsi_get_prot_op(sp->cmd) == SCSI_PROT_WRITE_PASS) { |
938 | DEBUG18(printk(KERN_DEBUG | 942 | ql_dbg(ql_dbg_io, vha, 0x3027, |
939 | "%s(): %p, sg entry %d - addr =0x%x" | 943 | "%s(): %p, sg_entry %d - " |
940 | "0x%x, len =%d\n", __func__ , cur_dsd, i, | 944 | "addr=0x%x0x%x, len=%d.\n", |
941 | LSD(sle_dma), MSD(sle_dma), sg_dma_len(sg))); | 945 | __func__, cur_dsd, i, |
946 | LSD(sle_dma), MSD(sle_dma), sg_dma_len(sg)); | ||
942 | } | 947 | } |
943 | *cur_dsd++ = cpu_to_le32(LSD(sle_dma)); | 948 | *cur_dsd++ = cpu_to_le32(LSD(sle_dma)); |
944 | *cur_dsd++ = cpu_to_le32(MSD(sle_dma)); | 949 | *cur_dsd++ = cpu_to_le32(MSD(sle_dma)); |
@@ -946,8 +951,9 @@ qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *ha, srb_t *sp, | |||
946 | 951 | ||
947 | if (scsi_get_prot_op(sp->cmd) == SCSI_PROT_WRITE_PASS) { | 952 | if (scsi_get_prot_op(sp->cmd) == SCSI_PROT_WRITE_PASS) { |
948 | cp = page_address(sg_page(sg)) + sg->offset; | 953 | cp = page_address(sg_page(sg)) + sg->offset; |
949 | DEBUG18(printk("%s(): Protection Data buffer = %p:\n", | 954 | ql_dbg(ql_dbg_io, vha, 0x3028, |
950 | __func__ , cp)); | 955 | "%s(): Protection Data buffer = %p.\n", __func__, |
956 | cp); | ||
951 | } | 957 | } |
952 | avail_dsds--; | 958 | avail_dsds--; |
953 | } | 959 | } |
@@ -996,22 +1002,16 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, | |||
996 | *((uint32_t *)(&cmd_pkt->entry_type)) = | 1002 | *((uint32_t *)(&cmd_pkt->entry_type)) = |
997 | __constant_cpu_to_le32(COMMAND_TYPE_CRC_2); | 1003 | __constant_cpu_to_le32(COMMAND_TYPE_CRC_2); |
998 | 1004 | ||
1005 | vha = sp->fcport->vha; | ||
1006 | ha = vha->hw; | ||
1007 | |||
999 | /* No data transfer */ | 1008 | /* No data transfer */ |
1000 | data_bytes = scsi_bufflen(cmd); | 1009 | data_bytes = scsi_bufflen(cmd); |
1001 | if (!data_bytes || cmd->sc_data_direction == DMA_NONE) { | 1010 | if (!data_bytes || cmd->sc_data_direction == DMA_NONE) { |
1002 | DEBUG18(printk(KERN_INFO "%s: Zero data bytes or DMA-NONE %d\n", | ||
1003 | __func__, data_bytes)); | ||
1004 | cmd_pkt->byte_count = __constant_cpu_to_le32(0); | 1011 | cmd_pkt->byte_count = __constant_cpu_to_le32(0); |
1005 | return QLA_SUCCESS; | 1012 | return QLA_SUCCESS; |
1006 | } | 1013 | } |
1007 | 1014 | ||
1008 | vha = sp->fcport->vha; | ||
1009 | ha = vha->hw; | ||
1010 | |||
1011 | DEBUG18(printk(KERN_DEBUG | ||
1012 | "%s(%ld): Executing cmd sp %p, prot_op=%u.\n", __func__, | ||
1013 | vha->host_no, sp, scsi_get_prot_op(sp->cmd))); | ||
1014 | |||
1015 | cmd_pkt->vp_index = sp->fcport->vp_idx; | 1015 | cmd_pkt->vp_index = sp->fcport->vp_idx; |
1016 | 1016 | ||
1017 | /* Set transfer direction */ | 1017 | /* Set transfer direction */ |
@@ -1056,8 +1056,6 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, | |||
1056 | 1056 | ||
1057 | /* Determine SCSI command length -- align to 4 byte boundary */ | 1057 | /* Determine SCSI command length -- align to 4 byte boundary */ |
1058 | if (cmd->cmd_len > 16) { | 1058 | if (cmd->cmd_len > 16) { |
1059 | DEBUG18(printk(KERN_INFO "%s(): **** SCSI CMD > 16\n", | ||
1060 | __func__)); | ||
1061 | additional_fcpcdb_len = cmd->cmd_len - 16; | 1059 | additional_fcpcdb_len = cmd->cmd_len - 16; |
1062 | if ((cmd->cmd_len % 4) != 0) { | 1060 | if ((cmd->cmd_len % 4) != 0) { |
1063 | /* SCSI cmd > 16 bytes must be multiple of 4 */ | 1061 | /* SCSI cmd > 16 bytes must be multiple of 4 */ |
@@ -1108,11 +1106,6 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, | |||
1108 | 1106 | ||
1109 | cmd_pkt->fcp_rsp_dseg_len = 0; /* Let response come in status iocb */ | 1107 | cmd_pkt->fcp_rsp_dseg_len = 0; /* Let response come in status iocb */ |
1110 | 1108 | ||
1111 | DEBUG18(printk(KERN_INFO "%s(%ld): Total SG(s) Entries %d, Data" | ||
1112 | "entries %d, data bytes %d, Protection entries %d\n", | ||
1113 | __func__, vha->host_no, tot_dsds, (tot_dsds-tot_prot_dsds), | ||
1114 | data_bytes, tot_prot_dsds)); | ||
1115 | |||
1116 | /* Compute dif len and adjust data len to incude protection */ | 1109 | /* Compute dif len and adjust data len to incude protection */ |
1117 | total_bytes = data_bytes; | 1110 | total_bytes = data_bytes; |
1118 | dif_bytes = 0; | 1111 | dif_bytes = 0; |
@@ -1150,14 +1143,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, | |||
1150 | additional_fcpcdb_len); | 1143 | additional_fcpcdb_len); |
1151 | *fcp_dl = htonl(total_bytes); | 1144 | *fcp_dl = htonl(total_bytes); |
1152 | 1145 | ||
1153 | DEBUG18(printk(KERN_INFO "%s(%ld): dif bytes = 0x%x (%d), total bytes" | ||
1154 | " = 0x%x (%d), dat block size =0x%x (%d)\n", __func__, | ||
1155 | vha->host_no, dif_bytes, dif_bytes, total_bytes, total_bytes, | ||
1156 | crc_ctx_pkt->blk_size, crc_ctx_pkt->blk_size)); | ||
1157 | |||
1158 | if (!data_bytes || cmd->sc_data_direction == DMA_NONE) { | 1146 | if (!data_bytes || cmd->sc_data_direction == DMA_NONE) { |
1159 | DEBUG18(printk(KERN_INFO "%s: Zero data bytes or DMA-NONE %d\n", | ||
1160 | __func__, data_bytes)); | ||
1161 | cmd_pkt->byte_count = __constant_cpu_to_le32(0); | 1147 | cmd_pkt->byte_count = __constant_cpu_to_le32(0); |
1162 | return QLA_SUCCESS; | 1148 | return QLA_SUCCESS; |
1163 | } | 1149 | } |
@@ -1182,8 +1168,6 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, | |||
1182 | return QLA_SUCCESS; | 1168 | return QLA_SUCCESS; |
1183 | 1169 | ||
1184 | crc_queuing_error: | 1170 | crc_queuing_error: |
1185 | DEBUG18(qla_printk(KERN_INFO, ha, | ||
1186 | "CMD sent FAILED crc_q error:sp = %p\n", sp)); | ||
1187 | /* Cleanup will be performed by the caller */ | 1171 | /* Cleanup will be performed by the caller */ |
1188 | 1172 | ||
1189 | return QLA_FUNCTION_FAILED; | 1173 | return QLA_FUNCTION_FAILED; |
@@ -1225,8 +1209,8 @@ qla24xx_start_scsi(srb_t *sp) | |||
1225 | 1209 | ||
1226 | /* Send marker if required */ | 1210 | /* Send marker if required */ |
1227 | if (vha->marker_needed != 0) { | 1211 | if (vha->marker_needed != 0) { |
1228 | if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) | 1212 | if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) != |
1229 | != QLA_SUCCESS) | 1213 | QLA_SUCCESS) |
1230 | return QLA_FUNCTION_FAILED; | 1214 | return QLA_FUNCTION_FAILED; |
1231 | vha->marker_needed = 0; | 1215 | vha->marker_needed = 0; |
1232 | } | 1216 | } |
@@ -1243,8 +1227,9 @@ qla24xx_start_scsi(srb_t *sp) | |||
1243 | if (!req->outstanding_cmds[handle]) | 1227 | if (!req->outstanding_cmds[handle]) |
1244 | break; | 1228 | break; |
1245 | } | 1229 | } |
1246 | if (index == MAX_OUTSTANDING_COMMANDS) | 1230 | if (index == MAX_OUTSTANDING_COMMANDS) { |
1247 | goto queuing_error; | 1231 | goto queuing_error; |
1232 | } | ||
1248 | 1233 | ||
1249 | /* Map the sg table so we have an accurate count of sg entries needed */ | 1234 | /* Map the sg table so we have an accurate count of sg entries needed */ |
1250 | if (scsi_sg_count(cmd)) { | 1235 | if (scsi_sg_count(cmd)) { |
@@ -1256,8 +1241,7 @@ qla24xx_start_scsi(srb_t *sp) | |||
1256 | nseg = 0; | 1241 | nseg = 0; |
1257 | 1242 | ||
1258 | tot_dsds = nseg; | 1243 | tot_dsds = nseg; |
1259 | 1244 | req_cnt = qla24xx_calc_iocbs(vha, tot_dsds); | |
1260 | req_cnt = qla24xx_calc_iocbs(tot_dsds); | ||
1261 | if (req->cnt < (req_cnt + 2)) { | 1245 | if (req->cnt < (req_cnt + 2)) { |
1262 | cnt = RD_REG_DWORD_RELAXED(req->req_q_out); | 1246 | cnt = RD_REG_DWORD_RELAXED(req->req_q_out); |
1263 | 1247 | ||
@@ -1322,7 +1306,6 @@ qla24xx_start_scsi(srb_t *sp) | |||
1322 | /* Specify response queue number where completion should happen */ | 1306 | /* Specify response queue number where completion should happen */ |
1323 | cmd_pkt->entry_status = (uint8_t) rsp->id; | 1307 | cmd_pkt->entry_status = (uint8_t) rsp->id; |
1324 | wmb(); | 1308 | wmb(); |
1325 | |||
1326 | /* Adjust ring index. */ | 1309 | /* Adjust ring index. */ |
1327 | req->ring_index++; | 1310 | req->ring_index++; |
1328 | if (req->ring_index == req->length) { | 1311 | if (req->ring_index == req->length) { |
@@ -1534,9 +1517,6 @@ queuing_error: | |||
1534 | /* Cleanup will be performed by the caller (queuecommand) */ | 1517 | /* Cleanup will be performed by the caller (queuecommand) */ |
1535 | 1518 | ||
1536 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1519 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
1537 | |||
1538 | DEBUG18(qla_printk(KERN_INFO, ha, | ||
1539 | "CMD sent FAILED SCSI prot_op:%02x\n", scsi_get_prot_op(cmd))); | ||
1540 | return QLA_FUNCTION_FAILED; | 1520 | return QLA_FUNCTION_FAILED; |
1541 | } | 1521 | } |
1542 | 1522 | ||
@@ -1581,8 +1561,11 @@ qla2x00_alloc_iocbs(scsi_qla_host_t *vha, srb_t *sp) | |||
1581 | if (!req->outstanding_cmds[handle]) | 1561 | if (!req->outstanding_cmds[handle]) |
1582 | break; | 1562 | break; |
1583 | } | 1563 | } |
1584 | if (index == MAX_OUTSTANDING_COMMANDS) | 1564 | if (index == MAX_OUTSTANDING_COMMANDS) { |
1565 | ql_log(ql_log_warn, vha, 0x700b, | ||
1566 | "No room on oustanding cmd array.\n"); | ||
1585 | goto queuing_error; | 1567 | goto queuing_error; |
1568 | } | ||
1586 | 1569 | ||
1587 | /* Prep command array. */ | 1570 | /* Prep command array. */ |
1588 | req->current_outstanding_cmd = handle; | 1571 | req->current_outstanding_cmd = handle; |
@@ -1999,8 +1982,11 @@ qla2x00_start_sp(srb_t *sp) | |||
1999 | rval = QLA_FUNCTION_FAILED; | 1982 | rval = QLA_FUNCTION_FAILED; |
2000 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1983 | spin_lock_irqsave(&ha->hardware_lock, flags); |
2001 | pkt = qla2x00_alloc_iocbs(sp->fcport->vha, sp); | 1984 | pkt = qla2x00_alloc_iocbs(sp->fcport->vha, sp); |
2002 | if (!pkt) | 1985 | if (!pkt) { |
1986 | ql_log(ql_log_warn, sp->fcport->vha, 0x700c, | ||
1987 | "qla2x00_alloc_iocbs failed.\n"); | ||
2003 | goto done; | 1988 | goto done; |
1989 | } | ||
2004 | 1990 | ||
2005 | rval = QLA_SUCCESS; | 1991 | rval = QLA_SUCCESS; |
2006 | switch (ctx->type) { | 1992 | switch (ctx->type) { |