[v1,1/7] bus: mhi: core: Rely on accurate method to determine EDL mode
diff mbox series

Message ID 1617067704-28850-2-git-send-email-bbhatt@codeaurora.org
State Accepted
Commit 418bec695696abd1b4d5abca85f143ead2ffedac
Headers show
Series
  • MHI Emergency download and flash programmer support
Related show

Commit Message

Bhaumik Bhatt March 30, 2021, 1:28 a.m. UTC
Relying on the current execution environment to determine if EDL
image was downloaded should not be done as the execution
environment can change at this point in error cases and we may
misread it. Instead, MHI can rely on the local 'fw_name' variable
as a safer alternative.

Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/bus/mhi/core/boot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Loic Poulain March 30, 2021, 8 a.m. UTC | #1
On Tue, 30 Mar 2021 at 03:28, Bhaumik Bhatt <bbhatt@codeaurora.org> wrote:
>
> Relying on the current execution environment to determine if EDL
> image was downloaded should not be done as the execution
> environment can change at this point in error cases and we may
> misread it. Instead, MHI can rely on the local 'fw_name' variable
> as a safer alternative.
>
> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Reviewed-by: Loic Poulain <loic.poulain@linaro.org>

Patch
diff mbox series

diff --git a/drivers/bus/mhi/core/boot.c b/drivers/bus/mhi/core/boot.c
index 08c2874..84c2117 100644
--- a/drivers/bus/mhi/core/boot.c
+++ b/drivers/bus/mhi/core/boot.c
@@ -460,7 +460,8 @@  void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl)
 		goto error_fw_load;
 	}
 
-	if (mhi_cntrl->ee == MHI_EE_EDL) {
+	/* Exit if EDL image was loaded */
+	if (fw_name == mhi_cntrl->edl_image) {
 		release_firmware(firmware);
 		return;
 	}