aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_bsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_bsg.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index dcf088262b20..d521569e6620 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -377,6 +377,11 @@ lpfc_bsg_send_mgmt_cmd(struct fc_bsg_job *job)
377 377
378 if (rc == IOCB_SUCCESS) 378 if (rc == IOCB_SUCCESS)
379 return 0; /* done for now */ 379 return 0; /* done for now */
380 else if (rc == IOCB_BUSY)
381 rc = EAGAIN;
382 else
383 rc = EIO;
384
380 385
381 /* iocb failed so cleanup */ 386 /* iocb failed so cleanup */
382 pci_unmap_sg(phba->pcidev, job->request_payload.sg_list, 387 pci_unmap_sg(phba->pcidev, job->request_payload.sg_list,
@@ -625,6 +630,10 @@ lpfc_bsg_rport_els(struct fc_bsg_job *job)
625 lpfc_nlp_put(ndlp); 630 lpfc_nlp_put(ndlp);
626 if (rc == IOCB_SUCCESS) 631 if (rc == IOCB_SUCCESS)
627 return 0; /* done for now */ 632 return 0; /* done for now */
633 else if (rc == IOCB_BUSY)
634 rc = EAGAIN;
635 else
636 rc = EIO;
628 637
629 pci_unmap_sg(phba->pcidev, job->request_payload.sg_list, 638 pci_unmap_sg(phba->pcidev, job->request_payload.sg_list,
630 job->request_payload.sg_cnt, DMA_TO_DEVICE); 639 job->request_payload.sg_cnt, DMA_TO_DEVICE);
@@ -953,10 +962,22 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
953 if (phba->sli_rev == LPFC_SLI_REV4) { 962 if (phba->sli_rev == LPFC_SLI_REV4) {
954 evt_dat->immed_dat = phba->ctx_idx; 963 evt_dat->immed_dat = phba->ctx_idx;
955 phba->ctx_idx = (phba->ctx_idx + 1) % 64; 964 phba->ctx_idx = (phba->ctx_idx + 1) % 64;
965 /* Provide warning for over-run of the ct_ctx array */
966 if (phba->ct_ctx[evt_dat->immed_dat].flags &
967 UNSOL_VALID)
968 lpfc_printf_log(phba, KERN_WARNING, LOG_ELS,
969 "2717 CT context array entry "
970 "[%d] over-run: oxid:x%x, "
971 "sid:x%x\n", phba->ctx_idx,
972 phba->ct_ctx[
973 evt_dat->immed_dat].oxid,
974 phba->ct_ctx[
975 evt_dat->immed_dat].SID);
956 phba->ct_ctx[evt_dat->immed_dat].oxid = 976 phba->ct_ctx[evt_dat->immed_dat].oxid =
957 piocbq->iocb.ulpContext; 977 piocbq->iocb.ulpContext;
958 phba->ct_ctx[evt_dat->immed_dat].SID = 978 phba->ct_ctx[evt_dat->immed_dat].SID =
959 piocbq->iocb.un.rcvels.remoteID; 979 piocbq->iocb.un.rcvels.remoteID;
980 phba->ct_ctx[evt_dat->immed_dat].flags = UNSOL_VALID;
960 } else 981 } else
961 evt_dat->immed_dat = piocbq->iocb.ulpContext; 982 evt_dat->immed_dat = piocbq->iocb.ulpContext;
962 983
@@ -1314,6 +1335,21 @@ lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct fc_bsg_job *job, uint32_t tag,
1314 rc = IOCB_ERROR; 1335 rc = IOCB_ERROR;
1315 goto issue_ct_rsp_exit; 1336 goto issue_ct_rsp_exit;
1316 } 1337 }
1338
1339 /* Check if the ndlp is active */
1340 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
1341 rc = -IOCB_ERROR;
1342 goto issue_ct_rsp_exit;
1343 }
1344
1345 /* get a refernece count so the ndlp doesn't go away while
1346 * we respond
1347 */
1348 if (!lpfc_nlp_get(ndlp)) {
1349 rc = -IOCB_ERROR;
1350 goto issue_ct_rsp_exit;
1351 }
1352
1317 icmd->un.ulpWord[3] = ndlp->nlp_rpi; 1353 icmd->un.ulpWord[3] = ndlp->nlp_rpi;
1318 /* The exchange is done, mark the entry as invalid */ 1354 /* The exchange is done, mark the entry as invalid */
1319 phba->ct_ctx[tag].flags &= ~UNSOL_VALID; 1355 phba->ct_ctx[tag].flags &= ~UNSOL_VALID;