Unverified Commit ae387a2b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11992 scsi: lpfc: Handle mailbox timeouts in lpfc_get_sfp_info

parents e4fe1cc5 c4963dbe
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -7304,13 +7304,13 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
	}
	mbox->vport = phba->pport;
	mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context;

	rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
	rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_SLI4_CONFIG_TMO);
	if (rc == MBX_NOT_FINISHED) {
		rc = 1;
		goto error;
	}

	if (rc == MBX_TIMEOUT)
		goto error;
	if (phba->sli_rev == LPFC_SLI_REV4)
		mp = (struct lpfc_dmabuf *)(mbox->ctx_buf);
	else
@@ -7364,7 +7364,10 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
	}

	mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context;
	rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
	rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_SLI4_CONFIG_TMO);

	if (rc == MBX_TIMEOUT)
		goto error;
	if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) {
		rc = 1;
		goto error;
@@ -7375,8 +7378,10 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
			     DMP_SFF_PAGE_A2_SIZE);

error:
	if (mbox->mbox_flag & LPFC_MBX_WAKE) {
		mbox->ctx_buf = mpsave;
		lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED);
	}

	return rc;