diff options
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_bsg.c | 7 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 8 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 30 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 131 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.h | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 183 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli4.h | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_version.h | 2 |
10 files changed, 318 insertions, 49 deletions
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index b92aec989d60..82134d20e2d8 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c | |||
@@ -2629,7 +2629,7 @@ static int lpfcdiag_loop_get_xri(struct lpfc_hba *phba, uint16_t rpi, | |||
2629 | rspiocbq, | 2629 | rspiocbq, |
2630 | (phba->fc_ratov * 2) | 2630 | (phba->fc_ratov * 2) |
2631 | + LPFC_DRVR_TIMEOUT); | 2631 | + LPFC_DRVR_TIMEOUT); |
2632 | if (iocb_stat) { | 2632 | if ((iocb_stat != IOCB_SUCCESS) || (rsp->ulpStatus != IOSTAT_SUCCESS)) { |
2633 | ret_val = -EIO; | 2633 | ret_val = -EIO; |
2634 | goto err_get_xri_exit; | 2634 | goto err_get_xri_exit; |
2635 | } | 2635 | } |
@@ -3204,8 +3204,9 @@ lpfc_bsg_diag_loopback_run(struct fc_bsg_job *job) | |||
3204 | rspiocbq, (phba->fc_ratov * 2) + | 3204 | rspiocbq, (phba->fc_ratov * 2) + |
3205 | LPFC_DRVR_TIMEOUT); | 3205 | LPFC_DRVR_TIMEOUT); |
3206 | 3206 | ||
3207 | if ((iocb_stat != IOCB_SUCCESS) || ((phba->sli_rev < LPFC_SLI_REV4) && | 3207 | if ((iocb_stat != IOCB_SUCCESS) || |
3208 | (rsp->ulpStatus != IOCB_SUCCESS))) { | 3208 | ((phba->sli_rev < LPFC_SLI_REV4) && |
3209 | (rsp->ulpStatus != IOSTAT_SUCCESS))) { | ||
3209 | lpfc_printf_log(phba, KERN_ERR, LOG_LIBDFC, | 3210 | lpfc_printf_log(phba, KERN_ERR, LOG_LIBDFC, |
3210 | "3126 Failed loopback test issue iocb: " | 3211 | "3126 Failed loopback test issue iocb: " |
3211 | "iocb_stat:x%x\n", iocb_stat); | 3212 | "iocb_stat:x%x\n", iocb_stat); |
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 02e8cd923d0a..da61d8dc0449 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -280,7 +280,7 @@ lpfc_ct_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *ctiocb) | |||
280 | buf_ptr = (struct lpfc_dmabuf *) ctiocb->context3; | 280 | buf_ptr = (struct lpfc_dmabuf *) ctiocb->context3; |
281 | lpfc_mbuf_free(phba, buf_ptr->virt, buf_ptr->phys); | 281 | lpfc_mbuf_free(phba, buf_ptr->virt, buf_ptr->phys); |
282 | kfree(buf_ptr); | 282 | kfree(buf_ptr); |
283 | ctiocb->context1 = NULL; | 283 | ctiocb->context3 = NULL; |
284 | } | 284 | } |
285 | lpfc_sli_release_iocbq(phba, ctiocb); | 285 | lpfc_sli_release_iocbq(phba, ctiocb); |
286 | return 0; | 286 | return 0; |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 7801601aa5d9..883ea2d9f237 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -4171,8 +4171,6 @@ lpfc_initialize_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
4171 | NLP_INT_NODE_ACT(ndlp); | 4171 | NLP_INT_NODE_ACT(ndlp); |
4172 | atomic_set(&ndlp->cmd_pending, 0); | 4172 | atomic_set(&ndlp->cmd_pending, 0); |
4173 | ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; | 4173 | ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; |
4174 | if (vport->phba->sli_rev == LPFC_SLI_REV4) | ||
4175 | ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); | ||
4176 | } | 4174 | } |
4177 | 4175 | ||
4178 | struct lpfc_nodelist * | 4176 | struct lpfc_nodelist * |
@@ -4217,6 +4215,9 @@ lpfc_enable_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
4217 | lpfc_initialize_node(vport, ndlp, did); | 4215 | lpfc_initialize_node(vport, ndlp, did); |
4218 | 4216 | ||
4219 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); | 4217 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); |
4218 | if (vport->phba->sli_rev == LPFC_SLI_REV4) | ||
4219 | ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); | ||
4220 | |||
4220 | 4221 | ||
4221 | if (state != NLP_STE_UNUSED_NODE) | 4222 | if (state != NLP_STE_UNUSED_NODE) |
4222 | lpfc_nlp_set_state(vport, ndlp, state); | 4223 | lpfc_nlp_set_state(vport, ndlp, state); |
@@ -5617,6 +5618,9 @@ lpfc_nlp_init(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
5617 | 5618 | ||
5618 | lpfc_initialize_node(vport, ndlp, did); | 5619 | lpfc_initialize_node(vport, ndlp, did); |
5619 | INIT_LIST_HEAD(&ndlp->nlp_listp); | 5620 | INIT_LIST_HEAD(&ndlp->nlp_listp); |
5621 | if (vport->phba->sli_rev == LPFC_SLI_REV4) | ||
5622 | ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); | ||
5623 | |||
5620 | 5624 | ||
5621 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, | 5625 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, |
5622 | "node init: did:x%x", | 5626 | "node init: did:x%x", |
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 086c3f28caa6..5464b116d328 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -3439,7 +3439,8 @@ struct els_request64_wqe { | |||
3439 | #define els_req64_hopcnt_SHIFT 24 | 3439 | #define els_req64_hopcnt_SHIFT 24 |
3440 | #define els_req64_hopcnt_MASK 0x000000ff | 3440 | #define els_req64_hopcnt_MASK 0x000000ff |
3441 | #define els_req64_hopcnt_WORD word13 | 3441 | #define els_req64_hopcnt_WORD word13 |
3442 | uint32_t reserved[2]; | 3442 | uint32_t word14; |
3443 | uint32_t max_response_payload_len; | ||
3443 | }; | 3444 | }; |
3444 | 3445 | ||
3445 | struct xmit_els_rsp64_wqe { | 3446 | struct xmit_els_rsp64_wqe { |
@@ -3554,7 +3555,8 @@ struct gen_req64_wqe { | |||
3554 | uint32_t relative_offset; | 3555 | uint32_t relative_offset; |
3555 | struct wqe_rctl_dfctl wge_ctl; /* word 5 */ | 3556 | struct wqe_rctl_dfctl wge_ctl; /* word 5 */ |
3556 | struct wqe_common wqe_com; /* words 6-11 */ | 3557 | struct wqe_common wqe_com; /* words 6-11 */ |
3557 | uint32_t rsvd_12_15[4]; | 3558 | uint32_t rsvd_12_14[3]; |
3559 | uint32_t max_response_payload_len; | ||
3558 | }; | 3560 | }; |
3559 | 3561 | ||
3560 | struct create_xri_wqe { | 3562 | struct create_xri_wqe { |
@@ -3584,7 +3586,13 @@ struct abort_cmd_wqe { | |||
3584 | 3586 | ||
3585 | struct fcp_iwrite64_wqe { | 3587 | struct fcp_iwrite64_wqe { |
3586 | struct ulp_bde64 bde; | 3588 | struct ulp_bde64 bde; |
3587 | uint32_t payload_offset_len; | 3589 | uint32_t word3; |
3590 | #define cmd_buff_len_SHIFT 16 | ||
3591 | #define cmd_buff_len_MASK 0x00000ffff | ||
3592 | #define cmd_buff_len_WORD word3 | ||
3593 | #define payload_offset_len_SHIFT 0 | ||
3594 | #define payload_offset_len_MASK 0x0000ffff | ||
3595 | #define payload_offset_len_WORD word3 | ||
3588 | uint32_t total_xfer_len; | 3596 | uint32_t total_xfer_len; |
3589 | uint32_t initial_xfer_len; | 3597 | uint32_t initial_xfer_len; |
3590 | struct wqe_common wqe_com; /* words 6-11 */ | 3598 | struct wqe_common wqe_com; /* words 6-11 */ |
@@ -3594,7 +3602,13 @@ struct fcp_iwrite64_wqe { | |||
3594 | 3602 | ||
3595 | struct fcp_iread64_wqe { | 3603 | struct fcp_iread64_wqe { |
3596 | struct ulp_bde64 bde; | 3604 | struct ulp_bde64 bde; |
3597 | uint32_t payload_offset_len; /* word 3 */ | 3605 | uint32_t word3; |
3606 | #define cmd_buff_len_SHIFT 16 | ||
3607 | #define cmd_buff_len_MASK 0x00000ffff | ||
3608 | #define cmd_buff_len_WORD word3 | ||
3609 | #define payload_offset_len_SHIFT 0 | ||
3610 | #define payload_offset_len_MASK 0x0000ffff | ||
3611 | #define payload_offset_len_WORD word3 | ||
3598 | uint32_t total_xfer_len; /* word 4 */ | 3612 | uint32_t total_xfer_len; /* word 4 */ |
3599 | uint32_t rsrvd5; /* word 5 */ | 3613 | uint32_t rsrvd5; /* word 5 */ |
3600 | struct wqe_common wqe_com; /* words 6-11 */ | 3614 | struct wqe_common wqe_com; /* words 6-11 */ |
@@ -3604,7 +3618,13 @@ struct fcp_iread64_wqe { | |||
3604 | 3618 | ||
3605 | struct fcp_icmnd64_wqe { | 3619 | struct fcp_icmnd64_wqe { |
3606 | struct ulp_bde64 bde; /* words 0-2 */ | 3620 | struct ulp_bde64 bde; /* words 0-2 */ |
3607 | uint32_t rsrvd3; /* word 3 */ | 3621 | uint32_t word3; |
3622 | #define cmd_buff_len_SHIFT 16 | ||
3623 | #define cmd_buff_len_MASK 0x00000ffff | ||
3624 | #define cmd_buff_len_WORD word3 | ||
3625 | #define payload_offset_len_SHIFT 0 | ||
3626 | #define payload_offset_len_MASK 0x0000ffff | ||
3627 | #define payload_offset_len_WORD word3 | ||
3608 | uint32_t rsrvd4; /* word 4 */ | 3628 | uint32_t rsrvd4; /* word 4 */ |
3609 | uint32_t rsrvd5; /* word 5 */ | 3629 | uint32_t rsrvd5; /* word 5 */ |
3610 | struct wqe_common wqe_com; /* words 6-11 */ | 3630 | struct wqe_common wqe_com; /* words 6-11 */ |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 647f5bfb3bd3..ca6bf2af7ce8 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -4545,7 +4545,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phba) | |||
4545 | pci_save_state(pdev); | 4545 | pci_save_state(pdev); |
4546 | 4546 | ||
4547 | /* PCIe EEH recovery on powerpc platforms needs fundamental reset */ | 4547 | /* PCIe EEH recovery on powerpc platforms needs fundamental reset */ |
4548 | if (pci_find_capability(pdev, PCI_CAP_ID_EXP)) | 4548 | if (pci_is_pcie(pdev)) |
4549 | pdev->needs_freset = 1; | 4549 | pdev->needs_freset = 1; |
4550 | 4550 | ||
4551 | return 0; | 4551 | return 0; |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index c913e8cc3b26..b2ede05a5f0a 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -1012,20 +1012,25 @@ lpfc_new_scsi_buf_s4(struct lpfc_vport *vport, int num_to_alloc) | |||
1012 | break; | 1012 | break; |
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | /* Allocate iotag for psb->cur_iocbq. */ | 1015 | |
1016 | iotag = lpfc_sli_next_iotag(phba, &psb->cur_iocbq); | 1016 | lxri = lpfc_sli4_next_xritag(phba); |
1017 | if (iotag == 0) { | 1017 | if (lxri == NO_XRI) { |
1018 | pci_pool_free(phba->lpfc_scsi_dma_buf_pool, | 1018 | pci_pool_free(phba->lpfc_scsi_dma_buf_pool, |
1019 | psb->data, psb->dma_handle); | 1019 | psb->data, psb->dma_handle); |
1020 | kfree(psb); | 1020 | kfree(psb); |
1021 | break; | 1021 | break; |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | lxri = lpfc_sli4_next_xritag(phba); | 1024 | /* Allocate iotag for psb->cur_iocbq. */ |
1025 | if (lxri == NO_XRI) { | 1025 | iotag = lpfc_sli_next_iotag(phba, &psb->cur_iocbq); |
1026 | if (iotag == 0) { | ||
1026 | pci_pool_free(phba->lpfc_scsi_dma_buf_pool, | 1027 | pci_pool_free(phba->lpfc_scsi_dma_buf_pool, |
1027 | psb->data, psb->dma_handle); | 1028 | psb->data, psb->dma_handle); |
1028 | kfree(psb); | 1029 | kfree(psb); |
1030 | lpfc_printf_log(phba, KERN_ERR, LOG_FCP, | ||
1031 | "3368 Failed to allocated IOTAG for" | ||
1032 | " XRI:0x%x\n", lxri); | ||
1033 | lpfc_sli4_free_xri(phba, lxri); | ||
1029 | break; | 1034 | break; |
1030 | } | 1035 | } |
1031 | psb->cur_iocbq.sli4_lxritag = lxri; | 1036 | psb->cur_iocbq.sli4_lxritag = lxri; |
@@ -4485,9 +4490,7 @@ lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_vport *vport, | |||
4485 | piocb->ulpContext = | 4490 | piocb->ulpContext = |
4486 | vport->phba->sli4_hba.rpi_ids[ndlp->nlp_rpi]; | 4491 | vport->phba->sli4_hba.rpi_ids[ndlp->nlp_rpi]; |
4487 | } | 4492 | } |
4488 | if (ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) { | 4493 | piocb->ulpFCP2Rcvy = (ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) ? 1 : 0; |
4489 | piocb->ulpFCP2Rcvy = 1; | ||
4490 | } | ||
4491 | piocb->ulpClass = (ndlp->nlp_fcp_info & 0x0f); | 4494 | piocb->ulpClass = (ndlp->nlp_fcp_info & 0x0f); |
4492 | 4495 | ||
4493 | /* ulpTimeout is only one byte */ | 4496 | /* ulpTimeout is only one byte */ |
@@ -4981,6 +4984,73 @@ lpfc_taskmgmt_name(uint8_t task_mgmt_cmd) | |||
4981 | } | 4984 | } |
4982 | } | 4985 | } |
4983 | 4986 | ||
4987 | |||
4988 | /** | ||
4989 | * lpfc_check_fcp_rsp - check the returned fcp_rsp to see if task failed | ||
4990 | * @vport: The virtual port for which this call is being executed. | ||
4991 | * @lpfc_cmd: Pointer to lpfc_scsi_buf data structure. | ||
4992 | * | ||
4993 | * This routine checks the FCP RSP INFO to see if the tsk mgmt command succeded | ||
4994 | * | ||
4995 | * Return code : | ||
4996 | * 0x2003 - Error | ||
4997 | * 0x2002 - Success | ||
4998 | **/ | ||
4999 | static int | ||
5000 | lpfc_check_fcp_rsp(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd) | ||
5001 | { | ||
5002 | struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp; | ||
5003 | uint32_t rsp_info; | ||
5004 | uint32_t rsp_len; | ||
5005 | uint8_t rsp_info_code; | ||
5006 | int ret = FAILED; | ||
5007 | |||
5008 | |||
5009 | if (fcprsp == NULL) | ||
5010 | lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, | ||
5011 | "0703 fcp_rsp is missing\n"); | ||
5012 | else { | ||
5013 | rsp_info = fcprsp->rspStatus2; | ||
5014 | rsp_len = be32_to_cpu(fcprsp->rspRspLen); | ||
5015 | rsp_info_code = fcprsp->rspInfo3; | ||
5016 | |||
5017 | |||
5018 | lpfc_printf_vlog(vport, KERN_INFO, | ||
5019 | LOG_FCP, | ||
5020 | "0706 fcp_rsp valid 0x%x," | ||
5021 | " rsp len=%d code 0x%x\n", | ||
5022 | rsp_info, | ||
5023 | rsp_len, rsp_info_code); | ||
5024 | |||
5025 | if ((fcprsp->rspStatus2&RSP_LEN_VALID) && (rsp_len == 8)) { | ||
5026 | switch (rsp_info_code) { | ||
5027 | case RSP_NO_FAILURE: | ||
5028 | lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, | ||
5029 | "0715 Task Mgmt No Failure\n"); | ||
5030 | ret = SUCCESS; | ||
5031 | break; | ||
5032 | case RSP_TM_NOT_SUPPORTED: /* TM rejected */ | ||
5033 | lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, | ||
5034 | "0716 Task Mgmt Target " | ||
5035 | "reject\n"); | ||
5036 | break; | ||
5037 | case RSP_TM_NOT_COMPLETED: /* TM failed */ | ||
5038 | lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, | ||
5039 | "0717 Task Mgmt Target " | ||
5040 | "failed TM\n"); | ||
5041 | break; | ||
5042 | case RSP_TM_INVALID_LU: /* TM to invalid LU! */ | ||
5043 | lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, | ||
5044 | "0718 Task Mgmt to invalid " | ||
5045 | "LUN\n"); | ||
5046 | break; | ||
5047 | } | ||
5048 | } | ||
5049 | } | ||
5050 | return ret; | ||
5051 | } | ||
5052 | |||
5053 | |||
4984 | /** | 5054 | /** |
4985 | * lpfc_send_taskmgmt - Generic SCSI Task Mgmt Handler | 5055 | * lpfc_send_taskmgmt - Generic SCSI Task Mgmt Handler |
4986 | * @vport: The virtual port for which this call is being executed. | 5056 | * @vport: The virtual port for which this call is being executed. |
@@ -5042,12 +5112,8 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct lpfc_rport_data *rdata, | |||
5042 | 5112 | ||
5043 | status = lpfc_sli_issue_iocb_wait(phba, LPFC_FCP_RING, | 5113 | status = lpfc_sli_issue_iocb_wait(phba, LPFC_FCP_RING, |
5044 | iocbq, iocbqrsp, lpfc_cmd->timeout); | 5114 | iocbq, iocbqrsp, lpfc_cmd->timeout); |
5045 | if (status != IOCB_SUCCESS) { | 5115 | if ((status != IOCB_SUCCESS) || |
5046 | if (status == IOCB_TIMEDOUT) { | 5116 | (iocbqrsp->iocb.ulpStatus != IOSTAT_SUCCESS)) { |
5047 | ret = TIMEOUT_ERROR; | ||
5048 | } else | ||
5049 | ret = FAILED; | ||
5050 | lpfc_cmd->status = IOSTAT_DRIVER_REJECT; | ||
5051 | lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, | 5117 | lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, |
5052 | "0727 TMF %s to TGT %d LUN %d failed (%d, %d) " | 5118 | "0727 TMF %s to TGT %d LUN %d failed (%d, %d) " |
5053 | "iocb_flag x%x\n", | 5119 | "iocb_flag x%x\n", |
@@ -5055,9 +5121,21 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct lpfc_rport_data *rdata, | |||
5055 | tgt_id, lun_id, iocbqrsp->iocb.ulpStatus, | 5121 | tgt_id, lun_id, iocbqrsp->iocb.ulpStatus, |
5056 | iocbqrsp->iocb.un.ulpWord[4], | 5122 | iocbqrsp->iocb.un.ulpWord[4], |
5057 | iocbq->iocb_flag); | 5123 | iocbq->iocb_flag); |
5058 | } else if (status == IOCB_BUSY) | 5124 | /* if ulpStatus != IOCB_SUCCESS, then status == IOCB_SUCCESS */ |
5059 | ret = FAILED; | 5125 | if (status == IOCB_SUCCESS) { |
5060 | else | 5126 | if (iocbqrsp->iocb.ulpStatus == IOSTAT_FCP_RSP_ERROR) |
5127 | /* Something in the FCP_RSP was invalid. | ||
5128 | * Check conditions */ | ||
5129 | ret = lpfc_check_fcp_rsp(vport, lpfc_cmd); | ||
5130 | else | ||
5131 | ret = FAILED; | ||
5132 | } else if (status == IOCB_TIMEDOUT) { | ||
5133 | ret = TIMEOUT_ERROR; | ||
5134 | } else { | ||
5135 | ret = FAILED; | ||
5136 | } | ||
5137 | lpfc_cmd->status = IOSTAT_DRIVER_REJECT; | ||
5138 | } else | ||
5061 | ret = SUCCESS; | 5139 | ret = SUCCESS; |
5062 | 5140 | ||
5063 | lpfc_sli_release_iocbq(phba, iocbqrsp); | 5141 | lpfc_sli_release_iocbq(phba, iocbqrsp); |
@@ -5181,7 +5259,7 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) | |||
5181 | unsigned tgt_id = cmnd->device->id; | 5259 | unsigned tgt_id = cmnd->device->id; |
5182 | unsigned int lun_id = cmnd->device->lun; | 5260 | unsigned int lun_id = cmnd->device->lun; |
5183 | struct lpfc_scsi_event_header scsi_event; | 5261 | struct lpfc_scsi_event_header scsi_event; |
5184 | int status, ret = SUCCESS; | 5262 | int status; |
5185 | 5263 | ||
5186 | if (!rdata) { | 5264 | if (!rdata) { |
5187 | lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, | 5265 | lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, |
@@ -5222,9 +5300,11 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) | |||
5222 | * So, continue on. | 5300 | * So, continue on. |
5223 | * We will report success if all the i/o aborts successfully. | 5301 | * We will report success if all the i/o aborts successfully. |
5224 | */ | 5302 | */ |
5225 | ret = lpfc_reset_flush_io_context(vport, tgt_id, lun_id, | 5303 | if (status == SUCCESS) |
5304 | status = lpfc_reset_flush_io_context(vport, tgt_id, lun_id, | ||
5226 | LPFC_CTX_LUN); | 5305 | LPFC_CTX_LUN); |
5227 | return ret; | 5306 | |
5307 | return status; | ||
5228 | } | 5308 | } |
5229 | 5309 | ||
5230 | /** | 5310 | /** |
@@ -5248,7 +5328,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) | |||
5248 | unsigned tgt_id = cmnd->device->id; | 5328 | unsigned tgt_id = cmnd->device->id; |
5249 | unsigned int lun_id = cmnd->device->lun; | 5329 | unsigned int lun_id = cmnd->device->lun; |
5250 | struct lpfc_scsi_event_header scsi_event; | 5330 | struct lpfc_scsi_event_header scsi_event; |
5251 | int status, ret = SUCCESS; | 5331 | int status; |
5252 | 5332 | ||
5253 | if (!rdata) { | 5333 | if (!rdata) { |
5254 | lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, | 5334 | lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, |
@@ -5289,9 +5369,10 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) | |||
5289 | * So, continue on. | 5369 | * So, continue on. |
5290 | * We will report success if all the i/o aborts successfully. | 5370 | * We will report success if all the i/o aborts successfully. |
5291 | */ | 5371 | */ |
5292 | ret = lpfc_reset_flush_io_context(vport, tgt_id, lun_id, | 5372 | if (status == SUCCESS) |
5373 | status = lpfc_reset_flush_io_context(vport, tgt_id, lun_id, | ||
5293 | LPFC_CTX_TGT); | 5374 | LPFC_CTX_TGT); |
5294 | return ret; | 5375 | return status; |
5295 | } | 5376 | } |
5296 | 5377 | ||
5297 | /** | 5378 | /** |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.h b/drivers/scsi/lpfc/lpfc_scsi.h index b1d9f7fcb911..852ff7def493 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.h +++ b/drivers/scsi/lpfc/lpfc_scsi.h | |||
@@ -73,6 +73,7 @@ struct fcp_rsp { | |||
73 | #define RSP_RO_MISMATCH_ERR 0x03 | 73 | #define RSP_RO_MISMATCH_ERR 0x03 |
74 | #define RSP_TM_NOT_SUPPORTED 0x04 /* Task mgmt function not supported */ | 74 | #define RSP_TM_NOT_SUPPORTED 0x04 /* Task mgmt function not supported */ |
75 | #define RSP_TM_NOT_COMPLETED 0x05 /* Task mgmt function not performed */ | 75 | #define RSP_TM_NOT_COMPLETED 0x05 /* Task mgmt function not performed */ |
76 | #define RSP_TM_INVALID_LU 0x09 /* Task mgmt function to invalid LU */ | ||
76 | 77 | ||
77 | uint32_t rspInfoRsvd; /* FCP_RSP_INFO bytes 4-7 (reserved) */ | 78 | uint32_t rspInfoRsvd; /* FCP_RSP_INFO bytes 4-7 (reserved) */ |
78 | 79 | ||
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 612f48973ff2..8f580fda443f 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -71,6 +71,8 @@ static int lpfc_sli4_post_els_sgl_list(struct lpfc_hba *, struct list_head *, | |||
71 | int); | 71 | int); |
72 | static void lpfc_sli4_hba_handle_eqe(struct lpfc_hba *, struct lpfc_eqe *, | 72 | static void lpfc_sli4_hba_handle_eqe(struct lpfc_hba *, struct lpfc_eqe *, |
73 | uint32_t); | 73 | uint32_t); |
74 | static bool lpfc_sli4_mbox_completions_pending(struct lpfc_hba *phba); | ||
75 | static bool lpfc_sli4_process_missed_mbox_completions(struct lpfc_hba *phba); | ||
74 | 76 | ||
75 | static IOCB_t * | 77 | static IOCB_t * |
76 | lpfc_get_iocb_from_iocbq(struct lpfc_iocbq *iocbq) | 78 | lpfc_get_iocb_from_iocbq(struct lpfc_iocbq *iocbq) |
@@ -6566,6 +6568,108 @@ lpfc_mbox_timeout(unsigned long ptr) | |||
6566 | return; | 6568 | return; |
6567 | } | 6569 | } |
6568 | 6570 | ||
6571 | /** | ||
6572 | * lpfc_sli4_mbox_completions_pending - check to see if any mailbox completions | ||
6573 | * are pending | ||
6574 | * @phba: Pointer to HBA context object. | ||
6575 | * | ||
6576 | * This function checks if any mailbox completions are present on the mailbox | ||
6577 | * completion queue. | ||
6578 | **/ | ||
6579 | bool | ||
6580 | lpfc_sli4_mbox_completions_pending(struct lpfc_hba *phba) | ||
6581 | { | ||
6582 | |||
6583 | uint32_t idx; | ||
6584 | struct lpfc_queue *mcq; | ||
6585 | struct lpfc_mcqe *mcqe; | ||
6586 | bool pending_completions = false; | ||
6587 | |||
6588 | if (unlikely(!phba) || (phba->sli_rev != LPFC_SLI_REV4)) | ||
6589 | return false; | ||
6590 | |||
6591 | /* Check for completions on mailbox completion queue */ | ||
6592 | |||
6593 | mcq = phba->sli4_hba.mbx_cq; | ||
6594 | idx = mcq->hba_index; | ||
6595 | while (bf_get_le32(lpfc_cqe_valid, mcq->qe[idx].cqe)) { | ||
6596 | mcqe = (struct lpfc_mcqe *)mcq->qe[idx].cqe; | ||
6597 | if (bf_get_le32(lpfc_trailer_completed, mcqe) && | ||
6598 | (!bf_get_le32(lpfc_trailer_async, mcqe))) { | ||
6599 | pending_completions = true; | ||
6600 | break; | ||
6601 | } | ||
6602 | idx = (idx + 1) % mcq->entry_count; | ||
6603 | if (mcq->hba_index == idx) | ||
6604 | break; | ||
6605 | } | ||
6606 | return pending_completions; | ||
6607 | |||
6608 | } | ||
6609 | |||
6610 | /** | ||
6611 | * lpfc_sli4_process_missed_mbox_completions - process mbox completions | ||
6612 | * that were missed. | ||
6613 | * @phba: Pointer to HBA context object. | ||
6614 | * | ||
6615 | * For sli4, it is possible to miss an interrupt. As such mbox completions | ||
6616 | * maybe missed causing erroneous mailbox timeouts to occur. This function | ||
6617 | * checks to see if mbox completions are on the mailbox completion queue | ||
6618 | * and will process all the completions associated with the eq for the | ||
6619 | * mailbox completion queue. | ||
6620 | **/ | ||
6621 | bool | ||
6622 | lpfc_sli4_process_missed_mbox_completions(struct lpfc_hba *phba) | ||
6623 | { | ||
6624 | |||
6625 | uint32_t eqidx; | ||
6626 | struct lpfc_queue *fpeq = NULL; | ||
6627 | struct lpfc_eqe *eqe; | ||
6628 | bool mbox_pending; | ||
6629 | |||
6630 | if (unlikely(!phba) || (phba->sli_rev != LPFC_SLI_REV4)) | ||
6631 | return false; | ||
6632 | |||
6633 | /* Find the eq associated with the mcq */ | ||
6634 | |||
6635 | if (phba->sli4_hba.hba_eq) | ||
6636 | for (eqidx = 0; eqidx < phba->cfg_fcp_io_channel; eqidx++) | ||
6637 | if (phba->sli4_hba.hba_eq[eqidx]->queue_id == | ||
6638 | phba->sli4_hba.mbx_cq->assoc_qid) { | ||
6639 | fpeq = phba->sli4_hba.hba_eq[eqidx]; | ||
6640 | break; | ||
6641 | } | ||
6642 | if (!fpeq) | ||
6643 | return false; | ||
6644 | |||
6645 | /* Turn off interrupts from this EQ */ | ||
6646 | |||
6647 | lpfc_sli4_eq_clr_intr(fpeq); | ||
6648 | |||
6649 | /* Check to see if a mbox completion is pending */ | ||
6650 | |||
6651 | mbox_pending = lpfc_sli4_mbox_completions_pending(phba); | ||
6652 | |||
6653 | /* | ||
6654 | * If a mbox completion is pending, process all the events on EQ | ||
6655 | * associated with the mbox completion queue (this could include | ||
6656 | * mailbox commands, async events, els commands, receive queue data | ||
6657 | * and fcp commands) | ||
6658 | */ | ||
6659 | |||
6660 | if (mbox_pending) | ||
6661 | while ((eqe = lpfc_sli4_eq_get(fpeq))) { | ||
6662 | lpfc_sli4_hba_handle_eqe(phba, eqe, eqidx); | ||
6663 | fpeq->EQ_processed++; | ||
6664 | } | ||
6665 | |||
6666 | /* Always clear and re-arm the EQ */ | ||
6667 | |||
6668 | lpfc_sli4_eq_release(fpeq, LPFC_QUEUE_REARM); | ||
6669 | |||
6670 | return mbox_pending; | ||
6671 | |||
6672 | } | ||
6569 | 6673 | ||
6570 | /** | 6674 | /** |
6571 | * lpfc_mbox_timeout_handler - Worker thread function to handle mailbox timeout | 6675 | * lpfc_mbox_timeout_handler - Worker thread function to handle mailbox timeout |
@@ -6583,6 +6687,10 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) | |||
6583 | struct lpfc_sli *psli = &phba->sli; | 6687 | struct lpfc_sli *psli = &phba->sli; |
6584 | struct lpfc_sli_ring *pring; | 6688 | struct lpfc_sli_ring *pring; |
6585 | 6689 | ||
6690 | /* If the mailbox completed, process the completion and return */ | ||
6691 | if (lpfc_sli4_process_missed_mbox_completions(phba)) | ||
6692 | return; | ||
6693 | |||
6586 | /* Check the pmbox pointer first. There is a race condition | 6694 | /* Check the pmbox pointer first. There is a race condition |
6587 | * between the mbox timeout handler getting executed in the | 6695 | * between the mbox timeout handler getting executed in the |
6588 | * worklist and the mailbox actually completing. When this | 6696 | * worklist and the mailbox actually completing. When this |
@@ -7077,6 +7185,10 @@ lpfc_sli4_async_mbox_block(struct lpfc_hba *phba) | |||
7077 | 1000) + jiffies; | 7185 | 1000) + jiffies; |
7078 | spin_unlock_irq(&phba->hbalock); | 7186 | spin_unlock_irq(&phba->hbalock); |
7079 | 7187 | ||
7188 | /* Make sure the mailbox is really active */ | ||
7189 | if (timeout) | ||
7190 | lpfc_sli4_process_missed_mbox_completions(phba); | ||
7191 | |||
7080 | /* Wait for the outstnading mailbox command to complete */ | 7192 | /* Wait for the outstnading mailbox command to complete */ |
7081 | while (phba->sli.mbox_active) { | 7193 | while (phba->sli.mbox_active) { |
7082 | /* Check active mailbox complete status every 2ms */ | 7194 | /* Check active mailbox complete status every 2ms */ |
@@ -8076,6 +8188,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
8076 | bf_set(wqe_qosd, &wqe->els_req.wqe_com, 1); | 8188 | bf_set(wqe_qosd, &wqe->els_req.wqe_com, 1); |
8077 | bf_set(wqe_lenloc, &wqe->els_req.wqe_com, LPFC_WQE_LENLOC_NONE); | 8189 | bf_set(wqe_lenloc, &wqe->els_req.wqe_com, LPFC_WQE_LENLOC_NONE); |
8078 | bf_set(wqe_ebde_cnt, &wqe->els_req.wqe_com, 0); | 8190 | bf_set(wqe_ebde_cnt, &wqe->els_req.wqe_com, 0); |
8191 | wqe->els_req.max_response_payload_len = total_len - xmit_len; | ||
8079 | break; | 8192 | break; |
8080 | case CMD_XMIT_SEQUENCE64_CX: | 8193 | case CMD_XMIT_SEQUENCE64_CX: |
8081 | bf_set(wqe_ctxt_tag, &wqe->xmit_sequence.wqe_com, | 8194 | bf_set(wqe_ctxt_tag, &wqe->xmit_sequence.wqe_com, |
@@ -8120,8 +8233,10 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
8120 | command_type = FCP_COMMAND_DATA_OUT; | 8233 | command_type = FCP_COMMAND_DATA_OUT; |
8121 | /* word3 iocb=iotag wqe=payload_offset_len */ | 8234 | /* word3 iocb=iotag wqe=payload_offset_len */ |
8122 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ | 8235 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ |
8123 | wqe->fcp_iwrite.payload_offset_len = | 8236 | bf_set(payload_offset_len, &wqe->fcp_iwrite, |
8124 | xmit_len + sizeof(struct fcp_rsp); | 8237 | xmit_len + sizeof(struct fcp_rsp)); |
8238 | bf_set(cmd_buff_len, &wqe->fcp_iwrite, | ||
8239 | 0); | ||
8125 | /* word4 iocb=parameter wqe=total_xfer_length memcpy */ | 8240 | /* word4 iocb=parameter wqe=total_xfer_length memcpy */ |
8126 | /* word5 iocb=initial_xfer_len wqe=initial_xfer_len memcpy */ | 8241 | /* word5 iocb=initial_xfer_len wqe=initial_xfer_len memcpy */ |
8127 | bf_set(wqe_erp, &wqe->fcp_iwrite.wqe_com, | 8242 | bf_set(wqe_erp, &wqe->fcp_iwrite.wqe_com, |
@@ -8139,8 +8254,10 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
8139 | case CMD_FCP_IREAD64_CR: | 8254 | case CMD_FCP_IREAD64_CR: |
8140 | /* word3 iocb=iotag wqe=payload_offset_len */ | 8255 | /* word3 iocb=iotag wqe=payload_offset_len */ |
8141 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ | 8256 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ |
8142 | wqe->fcp_iread.payload_offset_len = | 8257 | bf_set(payload_offset_len, &wqe->fcp_iread, |
8143 | xmit_len + sizeof(struct fcp_rsp); | 8258 | xmit_len + sizeof(struct fcp_rsp)); |
8259 | bf_set(cmd_buff_len, &wqe->fcp_iread, | ||
8260 | 0); | ||
8144 | /* word4 iocb=parameter wqe=total_xfer_length memcpy */ | 8261 | /* word4 iocb=parameter wqe=total_xfer_length memcpy */ |
8145 | /* word5 iocb=initial_xfer_len wqe=initial_xfer_len memcpy */ | 8262 | /* word5 iocb=initial_xfer_len wqe=initial_xfer_len memcpy */ |
8146 | bf_set(wqe_erp, &wqe->fcp_iread.wqe_com, | 8263 | bf_set(wqe_erp, &wqe->fcp_iread.wqe_com, |
@@ -8156,8 +8273,13 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
8156 | bf_set(wqe_dbde, &wqe->fcp_iread.wqe_com, 1); | 8273 | bf_set(wqe_dbde, &wqe->fcp_iread.wqe_com, 1); |
8157 | break; | 8274 | break; |
8158 | case CMD_FCP_ICMND64_CR: | 8275 | case CMD_FCP_ICMND64_CR: |
8276 | /* word3 iocb=iotag wqe=payload_offset_len */ | ||
8277 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ | ||
8278 | bf_set(payload_offset_len, &wqe->fcp_icmd, | ||
8279 | xmit_len + sizeof(struct fcp_rsp)); | ||
8280 | bf_set(cmd_buff_len, &wqe->fcp_icmd, | ||
8281 | 0); | ||
8159 | /* word3 iocb=IO_TAG wqe=reserved */ | 8282 | /* word3 iocb=IO_TAG wqe=reserved */ |
8160 | wqe->fcp_icmd.rsrvd3 = 0; | ||
8161 | bf_set(wqe_pu, &wqe->fcp_icmd.wqe_com, 0); | 8283 | bf_set(wqe_pu, &wqe->fcp_icmd.wqe_com, 0); |
8162 | /* Always open the exchange */ | 8284 | /* Always open the exchange */ |
8163 | bf_set(wqe_xc, &wqe->fcp_icmd.wqe_com, 0); | 8285 | bf_set(wqe_xc, &wqe->fcp_icmd.wqe_com, 0); |
@@ -8203,6 +8325,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
8203 | bf_set(wqe_qosd, &wqe->gen_req.wqe_com, 1); | 8325 | bf_set(wqe_qosd, &wqe->gen_req.wqe_com, 1); |
8204 | bf_set(wqe_lenloc, &wqe->gen_req.wqe_com, LPFC_WQE_LENLOC_NONE); | 8326 | bf_set(wqe_lenloc, &wqe->gen_req.wqe_com, LPFC_WQE_LENLOC_NONE); |
8205 | bf_set(wqe_ebde_cnt, &wqe->gen_req.wqe_com, 0); | 8327 | bf_set(wqe_ebde_cnt, &wqe->gen_req.wqe_com, 0); |
8328 | wqe->gen_req.max_response_payload_len = total_len - xmit_len; | ||
8206 | command_type = OTHER_COMMAND; | 8329 | command_type = OTHER_COMMAND; |
8207 | break; | 8330 | break; |
8208 | case CMD_XMIT_ELS_RSP64_CX: | 8331 | case CMD_XMIT_ELS_RSP64_CX: |
@@ -10073,6 +10196,11 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba *phba, | |||
10073 | if (iocb_completed) { | 10196 | if (iocb_completed) { |
10074 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, | 10197 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, |
10075 | "0331 IOCB wake signaled\n"); | 10198 | "0331 IOCB wake signaled\n"); |
10199 | /* Note: we are not indicating if the IOCB has a success | ||
10200 | * status or not - that's for the caller to check. | ||
10201 | * IOCB_SUCCESS means just that the command was sent and | ||
10202 | * completed. Not that it completed successfully. | ||
10203 | * */ | ||
10076 | } else if (timeleft == 0) { | 10204 | } else if (timeleft == 0) { |
10077 | lpfc_printf_log(phba, KERN_ERR, LOG_SLI, | 10205 | lpfc_printf_log(phba, KERN_ERR, LOG_SLI, |
10078 | "0338 IOCB wait timeout error - no " | 10206 | "0338 IOCB wait timeout error - no " |
@@ -11074,8 +11202,11 @@ lpfc_sli4_iocb_param_transfer(struct lpfc_hba *phba, | |||
11074 | struct lpfc_iocbq *pIocbOut, | 11202 | struct lpfc_iocbq *pIocbOut, |
11075 | struct lpfc_wcqe_complete *wcqe) | 11203 | struct lpfc_wcqe_complete *wcqe) |
11076 | { | 11204 | { |
11205 | int numBdes, i; | ||
11077 | unsigned long iflags; | 11206 | unsigned long iflags; |
11078 | uint32_t status; | 11207 | uint32_t status, max_response; |
11208 | struct lpfc_dmabuf *dmabuf; | ||
11209 | struct ulp_bde64 *bpl, bde; | ||
11079 | size_t offset = offsetof(struct lpfc_iocbq, iocb); | 11210 | size_t offset = offsetof(struct lpfc_iocbq, iocb); |
11080 | 11211 | ||
11081 | memcpy((char *)pIocbIn + offset, (char *)pIocbOut + offset, | 11212 | memcpy((char *)pIocbIn + offset, (char *)pIocbOut + offset, |
@@ -11092,7 +11223,36 @@ lpfc_sli4_iocb_param_transfer(struct lpfc_hba *phba, | |||
11092 | pIocbIn->iocb.un.ulpWord[4] = wcqe->parameter; | 11223 | pIocbIn->iocb.un.ulpWord[4] = wcqe->parameter; |
11093 | else { | 11224 | else { |
11094 | pIocbIn->iocb.un.ulpWord[4] = wcqe->parameter; | 11225 | pIocbIn->iocb.un.ulpWord[4] = wcqe->parameter; |
11095 | pIocbIn->iocb.un.genreq64.bdl.bdeSize = wcqe->total_data_placed; | 11226 | switch (pIocbOut->iocb.ulpCommand) { |
11227 | case CMD_ELS_REQUEST64_CR: | ||
11228 | dmabuf = (struct lpfc_dmabuf *)pIocbOut->context3; | ||
11229 | bpl = (struct ulp_bde64 *)dmabuf->virt; | ||
11230 | bde.tus.w = le32_to_cpu(bpl[1].tus.w); | ||
11231 | max_response = bde.tus.f.bdeSize; | ||
11232 | break; | ||
11233 | case CMD_GEN_REQUEST64_CR: | ||
11234 | max_response = 0; | ||
11235 | if (!pIocbOut->context3) | ||
11236 | break; | ||
11237 | numBdes = pIocbOut->iocb.un.genreq64.bdl.bdeSize/ | ||
11238 | sizeof(struct ulp_bde64); | ||
11239 | dmabuf = (struct lpfc_dmabuf *)pIocbOut->context3; | ||
11240 | bpl = (struct ulp_bde64 *)dmabuf->virt; | ||
11241 | for (i = 0; i < numBdes; i++) { | ||
11242 | bde.tus.w = le32_to_cpu(bpl[i].tus.w); | ||
11243 | if (bde.tus.f.bdeFlags != BUFF_TYPE_BDE_64) | ||
11244 | max_response += bde.tus.f.bdeSize; | ||
11245 | } | ||
11246 | break; | ||
11247 | default: | ||
11248 | max_response = wcqe->total_data_placed; | ||
11249 | break; | ||
11250 | } | ||
11251 | if (max_response < wcqe->total_data_placed) | ||
11252 | pIocbIn->iocb.un.genreq64.bdl.bdeSize = max_response; | ||
11253 | else | ||
11254 | pIocbIn->iocb.un.genreq64.bdl.bdeSize = | ||
11255 | wcqe->total_data_placed; | ||
11096 | } | 11256 | } |
11097 | 11257 | ||
11098 | /* Convert BG errors for completion status */ | 11258 | /* Convert BG errors for completion status */ |
@@ -15098,6 +15258,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15098 | uint16_t max_rpi, rpi_limit; | 15258 | uint16_t max_rpi, rpi_limit; |
15099 | uint16_t rpi_remaining, lrpi = 0; | 15259 | uint16_t rpi_remaining, lrpi = 0; |
15100 | struct lpfc_rpi_hdr *rpi_hdr; | 15260 | struct lpfc_rpi_hdr *rpi_hdr; |
15261 | unsigned long iflag; | ||
15101 | 15262 | ||
15102 | max_rpi = phba->sli4_hba.max_cfg_param.max_rpi; | 15263 | max_rpi = phba->sli4_hba.max_cfg_param.max_rpi; |
15103 | rpi_limit = phba->sli4_hba.next_rpi; | 15264 | rpi_limit = phba->sli4_hba.next_rpi; |
@@ -15106,7 +15267,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15106 | * Fetch the next logical rpi. Because this index is logical, | 15267 | * Fetch the next logical rpi. Because this index is logical, |
15107 | * the driver starts at 0 each time. | 15268 | * the driver starts at 0 each time. |
15108 | */ | 15269 | */ |
15109 | spin_lock_irq(&phba->hbalock); | 15270 | spin_lock_irqsave(&phba->hbalock, iflag); |
15110 | rpi = find_next_zero_bit(phba->sli4_hba.rpi_bmask, rpi_limit, 0); | 15271 | rpi = find_next_zero_bit(phba->sli4_hba.rpi_bmask, rpi_limit, 0); |
15111 | if (rpi >= rpi_limit) | 15272 | if (rpi >= rpi_limit) |
15112 | rpi = LPFC_RPI_ALLOC_ERROR; | 15273 | rpi = LPFC_RPI_ALLOC_ERROR; |
@@ -15122,7 +15283,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15122 | */ | 15283 | */ |
15123 | if ((rpi == LPFC_RPI_ALLOC_ERROR) && | 15284 | if ((rpi == LPFC_RPI_ALLOC_ERROR) && |
15124 | (phba->sli4_hba.rpi_count >= max_rpi)) { | 15285 | (phba->sli4_hba.rpi_count >= max_rpi)) { |
15125 | spin_unlock_irq(&phba->hbalock); | 15286 | spin_unlock_irqrestore(&phba->hbalock, iflag); |
15126 | return rpi; | 15287 | return rpi; |
15127 | } | 15288 | } |
15128 | 15289 | ||
@@ -15131,7 +15292,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15131 | * extents. | 15292 | * extents. |
15132 | */ | 15293 | */ |
15133 | if (!phba->sli4_hba.rpi_hdrs_in_use) { | 15294 | if (!phba->sli4_hba.rpi_hdrs_in_use) { |
15134 | spin_unlock_irq(&phba->hbalock); | 15295 | spin_unlock_irqrestore(&phba->hbalock, iflag); |
15135 | return rpi; | 15296 | return rpi; |
15136 | } | 15297 | } |
15137 | 15298 | ||
@@ -15142,7 +15303,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) | |||
15142 | * how many are supported max by the device. | 15303 | * how many are supported max by the device. |
15143 | */ | 15304 | */ |
15144 | rpi_remaining = phba->sli4_hba.next_rpi - phba->sli4_hba.rpi_count; | 15305 | rpi_remaining = phba->sli4_hba.next_rpi - phba->sli4_hba.rpi_count; |
15145 | spin_unlock_irq(&phba->hbalock); | 15306 | spin_unlock_irqrestore(&phba->hbalock, iflag); |
15146 | if (rpi_remaining < LPFC_RPI_LOW_WATER_MARK) { | 15307 | if (rpi_remaining < LPFC_RPI_LOW_WATER_MARK) { |
15147 | rpi_hdr = lpfc_sli4_create_rpi_hdr(phba); | 15308 | rpi_hdr = lpfc_sli4_create_rpi_hdr(phba); |
15148 | if (!rpi_hdr) { | 15309 | if (!rpi_hdr) { |
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index 85120b77aa0e..298c8cd1a89d 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h | |||
@@ -673,6 +673,7 @@ void lpfc_sli4_queue_unset(struct lpfc_hba *); | |||
673 | int lpfc_sli4_post_sgl(struct lpfc_hba *, dma_addr_t, dma_addr_t, uint16_t); | 673 | int lpfc_sli4_post_sgl(struct lpfc_hba *, dma_addr_t, dma_addr_t, uint16_t); |
674 | int lpfc_sli4_repost_scsi_sgl_list(struct lpfc_hba *); | 674 | int lpfc_sli4_repost_scsi_sgl_list(struct lpfc_hba *); |
675 | uint16_t lpfc_sli4_next_xritag(struct lpfc_hba *); | 675 | uint16_t lpfc_sli4_next_xritag(struct lpfc_hba *); |
676 | void lpfc_sli4_free_xri(struct lpfc_hba *, int); | ||
676 | int lpfc_sli4_post_async_mbox(struct lpfc_hba *); | 677 | int lpfc_sli4_post_async_mbox(struct lpfc_hba *); |
677 | int lpfc_sli4_post_scsi_sgl_block(struct lpfc_hba *, struct list_head *, int); | 678 | int lpfc_sli4_post_scsi_sgl_block(struct lpfc_hba *, struct list_head *, int); |
678 | struct lpfc_cq_event *__lpfc_sli4_cq_event_alloc(struct lpfc_hba *); | 679 | struct lpfc_cq_event *__lpfc_sli4_cq_event_alloc(struct lpfc_hba *); |
diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index f58f18342bc3..e3094c4e143b 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h | |||
@@ -18,7 +18,7 @@ | |||
18 | * included with this package. * | 18 | * included with this package. * |
19 | *******************************************************************/ | 19 | *******************************************************************/ |
20 | 20 | ||
21 | #define LPFC_DRIVER_VERSION "8.3.42" | 21 | #define LPFC_DRIVER_VERSION "8.3.43" |
22 | #define LPFC_DRIVER_NAME "lpfc" | 22 | #define LPFC_DRIVER_NAME "lpfc" |
23 | 23 | ||
24 | /* Used for SLI 2/3 */ | 24 | /* Used for SLI 2/3 */ |