bus: mhi: core: Wait for MHI READY state in most scenarios
authorBhaumik Bhatt <bbhatt@codeaurora.org>
Tue, 30 Mar 2021 01:28:23 +0000 (18:28 -0700)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Wed, 31 Mar 2021 11:21:43 +0000 (16:51 +0530)
commite72919cebd19618b7341e69034b4d9f7120ff4de
tree748c7e795f8fdec112f3a1ece7d93cd33c4dfaad
parentd20e82d4d0167925191f57ccff8b6c406c06176f
bus: mhi: core: Wait for MHI READY state in most scenarios

When moving from SYS_ERROR transition to a different execution
environment, MHI host relies on the BHI register read to spawn
the next image download or wait for READY -> M0 states. The
device can at times move the execution environment to mission
mode when a pass through is expected, which can result in a
stall. Initiate a wait for MHI READY and write M0 such that the
device can proceed with state change event updates for any new
execution environment being entered. This allows us to remove
conditionals in handling firmware load for PBL modes and keeps
the execution environment out of the picture as it can change at
any time.

Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/1617067704-28850-7-git-send-email-bbhatt@codeaurora.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/bus/mhi/core/boot.c
drivers/bus/mhi/core/pm.c