aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index a246410ce9df..7f21b47db791 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -626,6 +626,7 @@ lpfc_sli4_fcp_xri_aborted(struct lpfc_hba *phba,
626 &phba->sli4_hba.lpfc_abts_scsi_buf_list, list) { 626 &phba->sli4_hba.lpfc_abts_scsi_buf_list, list) {
627 if (psb->cur_iocbq.sli4_xritag == xri) { 627 if (psb->cur_iocbq.sli4_xritag == xri) {
628 list_del(&psb->list); 628 list_del(&psb->list);
629 psb->exch_busy = 0;
629 psb->status = IOSTAT_SUCCESS; 630 psb->status = IOSTAT_SUCCESS;
630 spin_unlock_irqrestore( 631 spin_unlock_irqrestore(
631 &phba->sli4_hba.abts_scsi_buf_list_lock, 632 &phba->sli4_hba.abts_scsi_buf_list_lock,
@@ -688,11 +689,12 @@ lpfc_sli4_repost_scsi_sgl_list(struct lpfc_hba *phba)
688 list); 689 list);
689 if (status) { 690 if (status) {
690 /* Put this back on the abort scsi list */ 691 /* Put this back on the abort scsi list */
691 psb->status = IOSTAT_LOCAL_REJECT; 692 psb->exch_busy = 1;
692 psb->result = IOERR_ABORT_REQUESTED;
693 rc++; 693 rc++;
694 } else 694 } else {
695 psb->exch_busy = 0;
695 psb->status = IOSTAT_SUCCESS; 696 psb->status = IOSTAT_SUCCESS;
697 }
696 /* Put it back into the SCSI buffer list */ 698 /* Put it back into the SCSI buffer list */
697 lpfc_release_scsi_buf_s4(phba, psb); 699 lpfc_release_scsi_buf_s4(phba, psb);
698 } 700 }
@@ -796,19 +798,17 @@ lpfc_new_scsi_buf_s4(struct lpfc_vport *vport, int num_to_alloc)
796 */ 798 */
797 sgl->addr_hi = cpu_to_le32(putPaddrHigh(pdma_phys_fcp_cmd)); 799 sgl->addr_hi = cpu_to_le32(putPaddrHigh(pdma_phys_fcp_cmd));
798 sgl->addr_lo = cpu_to_le32(putPaddrLow(pdma_phys_fcp_cmd)); 800 sgl->addr_lo = cpu_to_le32(putPaddrLow(pdma_phys_fcp_cmd));
799 bf_set(lpfc_sli4_sge_len, sgl, sizeof(struct fcp_cmnd));
800 bf_set(lpfc_sli4_sge_last, sgl, 0); 801 bf_set(lpfc_sli4_sge_last, sgl, 0);
801 sgl->word2 = cpu_to_le32(sgl->word2); 802 sgl->word2 = cpu_to_le32(sgl->word2);
802 sgl->word3 = cpu_to_le32(sgl->word3); 803 sgl->sge_len = cpu_to_le32(sizeof(struct fcp_cmnd));
803 sgl++; 804 sgl++;
804 805
805 /* Setup the physical region for the FCP RSP */ 806 /* Setup the physical region for the FCP RSP */
806 sgl->addr_hi = cpu_to_le32(putPaddrHigh(pdma_phys_fcp_rsp)); 807 sgl->addr_hi = cpu_to_le32(putPaddrHigh(pdma_phys_fcp_rsp));
807 sgl->addr_lo = cpu_to_le32(putPaddrLow(pdma_phys_fcp_rsp)); 808 sgl->addr_lo = cpu_to_le32(putPaddrLow(pdma_phys_fcp_rsp));
808 bf_set(lpfc_sli4_sge_len, sgl, sizeof(struct fcp_rsp));
809 bf_set(lpfc_sli4_sge_last, sgl, 1); 809 bf_set(lpfc_sli4_sge_last, sgl, 1);
810 sgl->word2 = cpu_to_le32(sgl->word2); 810 sgl->word2 = cpu_to_le32(sgl->word2);
811 sgl->word3 = cpu_to_le32(sgl->word3); 811 sgl->sge_len = cpu_to_le32(sizeof(struct fcp_rsp));
812 812
813 /* 813 /*
814 * Since the IOCB for the FCP I/O is built into this 814 * Since the IOCB for the FCP I/O is built into this
@@ -839,11 +839,12 @@ lpfc_new_scsi_buf_s4(struct lpfc_vport *vport, int num_to_alloc)
839 psb->cur_iocbq.sli4_xritag); 839 psb->cur_iocbq.sli4_xritag);
840 if (status) { 840 if (status) {
841 /* Put this back on the abort scsi list */ 841 /* Put this back on the abort scsi list */
842 psb->status = IOSTAT_LOCAL_REJECT; 842 psb->exch_busy = 1;
843 psb->result = IOERR_ABORT_REQUESTED;
844 rc++; 843 rc++;
845 } else 844 } else {
845 psb->exch_busy = 0;
846 psb->status = IOSTAT_SUCCESS; 846 psb->status = IOSTAT_SUCCESS;
847 }
847 /* Put it back into the SCSI buffer list */ 848 /* Put it back into the SCSI buffer list */
848 lpfc_release_scsi_buf_s4(phba, psb); 849 lpfc_release_scsi_buf_s4(phba, psb);
849 break; 850 break;
@@ -857,11 +858,12 @@ lpfc_new_scsi_buf_s4(struct lpfc_vport *vport, int num_to_alloc)
857 list); 858 list);
858 if (status) { 859 if (status) {
859 /* Put this back on the abort scsi list */ 860 /* Put this back on the abort scsi list */
860 psb->status = IOSTAT_LOCAL_REJECT; 861 psb->exch_busy = 1;
861 psb->result = IOERR_ABORT_REQUESTED;
862 rc++; 862 rc++;
863 } else 863 } else {
864 psb->exch_busy = 0;
864 psb->status = IOSTAT_SUCCESS; 865 psb->status = IOSTAT_SUCCESS;
866 }
865 /* Put it back into the SCSI buffer list */ 867 /* Put it back into the SCSI buffer list */
866 lpfc_release_scsi_buf_s4(phba, psb); 868 lpfc_release_scsi_buf_s4(phba, psb);
867 } 869 }
@@ -951,8 +953,7 @@ lpfc_release_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_scsi_buf *psb)
951{ 953{
952 unsigned long iflag = 0; 954 unsigned long iflag = 0;
953 955
954 if (psb->status == IOSTAT_LOCAL_REJECT 956 if (psb->exch_busy) {
955 && psb->result == IOERR_ABORT_REQUESTED) {
956 spin_lock_irqsave(&phba->sli4_hba.abts_scsi_buf_list_lock, 957 spin_lock_irqsave(&phba->sli4_hba.abts_scsi_buf_list_lock,
957 iflag); 958 iflag);
958 psb->pCmd = NULL; 959 psb->pCmd = NULL;
@@ -1869,7 +1870,6 @@ lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
1869 scsi_for_each_sg(scsi_cmnd, sgel, nseg, num_bde) { 1870 scsi_for_each_sg(scsi_cmnd, sgel, nseg, num_bde) {
1870 physaddr = sg_dma_address(sgel); 1871 physaddr = sg_dma_address(sgel);
1871 dma_len = sg_dma_len(sgel); 1872 dma_len = sg_dma_len(sgel);
1872 bf_set(lpfc_sli4_sge_len, sgl, sg_dma_len(sgel));
1873 sgl->addr_lo = cpu_to_le32(putPaddrLow(physaddr)); 1873 sgl->addr_lo = cpu_to_le32(putPaddrLow(physaddr));
1874 sgl->addr_hi = cpu_to_le32(putPaddrHigh(physaddr)); 1874 sgl->addr_hi = cpu_to_le32(putPaddrHigh(physaddr));
1875 if ((num_bde + 1) == nseg) 1875 if ((num_bde + 1) == nseg)
@@ -1878,7 +1878,7 @@ lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
1878 bf_set(lpfc_sli4_sge_last, sgl, 0); 1878 bf_set(lpfc_sli4_sge_last, sgl, 0);
1879 bf_set(lpfc_sli4_sge_offset, sgl, dma_offset); 1879 bf_set(lpfc_sli4_sge_offset, sgl, dma_offset);
1880 sgl->word2 = cpu_to_le32(sgl->word2); 1880 sgl->word2 = cpu_to_le32(sgl->word2);
1881 sgl->word3 = cpu_to_le32(sgl->word3); 1881 sgl->sge_len = cpu_to_le32(dma_len);
1882 dma_offset += dma_len; 1882 dma_offset += dma_len;
1883 sgl++; 1883 sgl++;
1884 } 1884 }
@@ -2221,6 +2221,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
2221 2221
2222 lpfc_cmd->result = pIocbOut->iocb.un.ulpWord[4]; 2222 lpfc_cmd->result = pIocbOut->iocb.un.ulpWord[4];
2223 lpfc_cmd->status = pIocbOut->iocb.ulpStatus; 2223 lpfc_cmd->status = pIocbOut->iocb.ulpStatus;
2224 /* pick up SLI4 exhange busy status from HBA */
2225 lpfc_cmd->exch_busy = pIocbOut->iocb_flag & LPFC_EXCHANGE_BUSY;
2226
2224 if (pnode && NLP_CHK_NODE_ACT(pnode)) 2227 if (pnode && NLP_CHK_NODE_ACT(pnode))
2225 atomic_dec(&pnode->cmd_pending); 2228 atomic_dec(&pnode->cmd_pending);
2226 2229
@@ -2637,6 +2640,7 @@ lpfc_scsi_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
2637 } 2640 }
2638 phba->lpfc_get_scsi_buf = lpfc_get_scsi_buf; 2641 phba->lpfc_get_scsi_buf = lpfc_get_scsi_buf;
2639 phba->lpfc_rampdown_queue_depth = lpfc_rampdown_queue_depth; 2642 phba->lpfc_rampdown_queue_depth = lpfc_rampdown_queue_depth;
2643 phba->lpfc_scsi_cmd_iocb_cmpl = lpfc_scsi_cmd_iocb_cmpl;
2640 return 0; 2644 return 0;
2641} 2645}
2642 2646
@@ -2695,6 +2699,13 @@ lpfc_info(struct Scsi_Host *host)
2695 " port %s", 2699 " port %s",
2696 phba->Port); 2700 phba->Port);
2697 } 2701 }
2702 len = strlen(lpfcinfobuf);
2703 if (phba->sli4_hba.link_state.logical_speed) {
2704 snprintf(lpfcinfobuf + len,
2705 384-len,
2706 " Logical Link Speed: %d Mbps",
2707 phba->sli4_hba.link_state.logical_speed * 10);
2708 }
2698 } 2709 }
2699 return lpfcinfobuf; 2710 return lpfcinfobuf;
2700} 2711}
@@ -2990,6 +3001,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
2990 3001
2991 /* ABTS WQE must go to the same WQ as the WQE to be aborted */ 3002 /* ABTS WQE must go to the same WQ as the WQE to be aborted */
2992 abtsiocb->fcp_wqidx = iocb->fcp_wqidx; 3003 abtsiocb->fcp_wqidx = iocb->fcp_wqidx;
3004 abtsiocb->iocb_flag |= LPFC_USE_FCPWQIDX;
2993 3005
2994 if (lpfc_is_link_up(phba)) 3006 if (lpfc_is_link_up(phba))
2995 icmd->ulpCommand = CMD_ABORT_XRI_CN; 3007 icmd->ulpCommand = CMD_ABORT_XRI_CN;