aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_isr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c81
1 files changed, 14 insertions, 67 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 2003dbb70579..b28ac0a27e25 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -515,47 +515,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
515 515
516 case MBA_PORT_UPDATE: /* Port database update */ 516 case MBA_PORT_UPDATE: /* Port database update */
517 /* 517 /*
518 * If a single remote port just logged into (or logged out of)
519 * us, create a new entry in our rscn fcports list and handle
520 * the event like an RSCN.
521 */
522 if (ql2xprocessrscn &&
523 !IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA6312(ha) &&
524 !IS_QLA6322(ha) && !IS_QLA24XX(ha) && !IS_QLA54XX(ha) &&
525 ha->flags.init_done && mb[1] != 0xffff &&
526 ((ha->operating_mode == P2P && mb[1] != 0) ||
527 (ha->operating_mode != P2P && mb[1] !=
528 SNS_FIRST_LOOP_ID)) && (mb[2] == 6 || mb[2] == 7)) {
529 int rval;
530 fc_port_t *rscn_fcport;
531
532 /* Create new fcport for login. */
533 rscn_fcport = qla2x00_alloc_rscn_fcport(ha, GFP_ATOMIC);
534 if (rscn_fcport) {
535 DEBUG14(printk("scsi(%ld): Port Update -- "
536 "creating RSCN fcport %p for %x/%x/%x.\n",
537 ha->host_no, rscn_fcport, mb[1], mb[2],
538 mb[3]));
539
540 rscn_fcport->loop_id = mb[1];
541 rscn_fcport->d_id.b24 = INVALID_PORT_ID;
542 atomic_set(&rscn_fcport->state,
543 FCS_DEVICE_LOST);
544 list_add_tail(&rscn_fcport->list,
545 &ha->rscn_fcports);
546
547 rval = qla2x00_handle_port_rscn(ha, 0,
548 rscn_fcport, 1);
549 if (rval == QLA_SUCCESS)
550 break;
551 } else {
552 DEBUG14(printk("scsi(%ld): Port Update -- "
553 "-- unable to allocate RSCN fcport "
554 "login.\n", ha->host_no));
555 }
556 }
557
558 /*
559 * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET 518 * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET
560 * event etc. earlier indicating loop is down) then process 519 * event etc. earlier indicating loop is down) then process
561 * it. Otherwise ignore it and Wait for RSCN to come in. 520 * it. Otherwise ignore it and Wait for RSCN to come in.
@@ -753,25 +712,6 @@ qla2x00_process_response_queue(struct scsi_qla_host *ha)
753 case MS_IOCB_TYPE: 712 case MS_IOCB_TYPE:
754 qla2x00_ms_entry(ha, (ms_iocb_entry_t *)pkt); 713 qla2x00_ms_entry(ha, (ms_iocb_entry_t *)pkt);
755 break; 714 break;
756 case MBX_IOCB_TYPE:
757 if (!IS_QLA2100(ha) && !IS_QLA2200(ha) &&
758 !IS_QLA6312(ha) && !IS_QLA6322(ha)) {
759 if (pkt->sys_define == SOURCE_ASYNC_IOCB) {
760 qla2x00_process_iodesc(ha,
761 (struct mbx_entry *)pkt);
762 } else {
763 /* MBX IOCB Type Not Supported. */
764 DEBUG4(printk(KERN_WARNING
765 "scsi(%ld): Received unknown MBX "
766 "IOCB response pkt type=%x "
767 "source=%x entry status=%x.\n",
768 ha->host_no, pkt->entry_type,
769 pkt->sys_define,
770 pkt->entry_status));
771 }
772 break;
773 }
774 /* Fallthrough. */
775 default: 715 default:
776 /* Type Not Supported. */ 716 /* Type Not Supported. */
777 DEBUG4(printk(KERN_WARNING 717 DEBUG4(printk(KERN_WARNING
@@ -805,7 +745,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
805 uint16_t scsi_status; 745 uint16_t scsi_status;
806 uint8_t lscsi_status; 746 uint8_t lscsi_status;
807 int32_t resid; 747 int32_t resid;
808 uint32_t sense_len, rsp_info_len, resid_len; 748 uint32_t sense_len, rsp_info_len, resid_len, fw_resid_len;
809 uint8_t *rsp_info, *sense_data; 749 uint8_t *rsp_info, *sense_data;
810 750
811 sts = (sts_entry_t *) pkt; 751 sts = (sts_entry_t *) pkt;
@@ -844,8 +784,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
844 cp = sp->cmd; 784 cp = sp->cmd;
845 if (cp == NULL) { 785 if (cp == NULL) {
846 DEBUG2(printk("scsi(%ld): Command already returned back to OS " 786 DEBUG2(printk("scsi(%ld): Command already returned back to OS "
847 "pkt->handle=%d sp=%p sp->state:%d\n", 787 "pkt->handle=%d sp=%p.\n", ha->host_no, sts->handle, sp));
848 ha->host_no, sts->handle, sp, sp->state));
849 qla_printk(KERN_WARNING, ha, 788 qla_printk(KERN_WARNING, ha,
850 "Command is NULL: already returned to OS (sp=%p)\n", sp); 789 "Command is NULL: already returned to OS (sp=%p)\n", sp);
851 790
@@ -859,11 +798,12 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
859 798
860 fcport = sp->fcport; 799 fcport = sp->fcport;
861 800
862 sense_len = rsp_info_len = resid_len = 0; 801 sense_len = rsp_info_len = resid_len = fw_resid_len = 0;
863 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { 802 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
864 sense_len = le32_to_cpu(sts24->sense_len); 803 sense_len = le32_to_cpu(sts24->sense_len);
865 rsp_info_len = le32_to_cpu(sts24->rsp_data_len); 804 rsp_info_len = le32_to_cpu(sts24->rsp_data_len);
866 resid_len = le32_to_cpu(sts24->rsp_residual_count); 805 resid_len = le32_to_cpu(sts24->rsp_residual_count);
806 fw_resid_len = le32_to_cpu(sts24->residual_len);
867 rsp_info = sts24->data; 807 rsp_info = sts24->data;
868 sense_data = sts24->data; 808 sense_data = sts24->data;
869 host_to_fcp_swap(sts24->data, sizeof(sts24->data)); 809 host_to_fcp_swap(sts24->data, sizeof(sts24->data));
@@ -963,14 +903,21 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
963 903
964 case CS_DATA_UNDERRUN: 904 case CS_DATA_UNDERRUN:
965 resid = resid_len; 905 resid = resid_len;
906 /* Use F/W calculated residual length. */
907 if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
908 resid = fw_resid_len;
909
966 if (scsi_status & SS_RESIDUAL_UNDER) { 910 if (scsi_status & SS_RESIDUAL_UNDER) {
967 cp->resid = resid; 911 cp->resid = resid;
968 CMD_RESID_LEN(cp) = resid; 912 CMD_RESID_LEN(cp) = resid;
969 } else { 913 } else {
970 DEBUG2(printk(KERN_INFO 914 DEBUG2(printk(KERN_INFO
971 "scsi(%ld:%d:%d) UNDERRUN status detected " 915 "scsi(%ld:%d:%d) UNDERRUN status detected "
972 "0x%x-0x%x.\n", ha->host_no, cp->device->id, 916 "0x%x-0x%x. resid=0x%x fw_resid=0x%x cdb=0x%x "
973 cp->device->lun, comp_status, scsi_status)); 917 "os_underflow=0x%x\n", ha->host_no,
918 cp->device->id, cp->device->lun, comp_status,
919 scsi_status, resid_len, resid, cp->cmnd[0],
920 cp->underflow));
974 921
975 } 922 }
976 923
@@ -1181,7 +1128,7 @@ qla2x00_status_cont_entry(scsi_qla_host_t *ha, sts_cont_entry_t *pkt)
1181 cp = sp->cmd; 1128 cp = sp->cmd;
1182 if (cp == NULL) { 1129 if (cp == NULL) {
1183 DEBUG2(printk("%s(): Cmd already returned back to OS " 1130 DEBUG2(printk("%s(): Cmd already returned back to OS "
1184 "sp=%p sp->state:%d\n", __func__, sp, sp->state)); 1131 "sp=%p.\n", __func__, sp));
1185 qla_printk(KERN_INFO, ha, 1132 qla_printk(KERN_INFO, ha,
1186 "cmd is NULL: already returned to OS (sp=%p)\n", 1133 "cmd is NULL: already returned to OS (sp=%p)\n",
1187 sp); 1134 sp);