Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c61705f6 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

mhi: core: Skip RDDM download if execution env is unknown



If mhi_get_exec_env API returns MHI_EE_MAX skip RDDM download.
API returns this value if BHI offset read failed or BHI_EXECENV
register read fails. This indicates the underlying transport is
unresponsive so there is no need to trigger RDDM using SYSERR
or request SOC reset.

Change-Id: I0cc85af84f19b425c94fe8aea987ab03af6de032
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 6e8d77cd
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -217,6 +217,9 @@ static int __mhi_download_rddm_in_panic(struct mhi_controller *mhi_cntrl)
	 * waiting for image download completion.
	 */
	ee = mhi_get_exec_env(mhi_cntrl);
	if (ee == MHI_EE_MAX)
		goto err_no_rddm;

	if (ee != MHI_EE_RDDM) {

		MHI_CNTRL_LOG("Trigger device into RDDM mode using SYSERR\n");
@@ -265,10 +268,12 @@ static int __mhi_download_rddm_in_panic(struct mhi_controller *mhi_cntrl)
	ee = mhi_get_exec_env(mhi_cntrl);
	ret = mhi_read_reg(mhi_cntrl, base, BHIE_RXVECSTATUS_OFFS, &rx_status);

	MHI_CNTRL_ERR("Did not complete RDDM transfer\n");
	MHI_CNTRL_ERR("Current EE:%s\n", TO_MHI_EXEC_STR(ee));
	MHI_CNTRL_ERR("RXVEC_STATUS:0x%x, ret:%d\n", rx_status, ret);

err_no_rddm:
	MHI_CNTRL_ERR("Current EE:%s\n", TO_MHI_EXEC_STR(ee));
	MHI_CNTRL_ERR("Did not complete RDDM transfer\n");

	return -EIO;
}