Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bus: mhi: core: Improve debug messages for power up

Improve error message to be more descriptive if a failure occurs
with an invalid power up execution environment. Additionally, add
a debug log to print the execution environment and MHI state
before a power up is attempted to confirm if the device is in an
expected state. This helps clarify reasons for power up failures
such as the device being found in a PBL or Emergency Download
Mode execution environment and the host expected a full power up
with Pass-Through and no image loading involved.

Link: https://lore.kernel.org/r/1620072038-36160-1-git-send-email-bbhatt@codeaurora.org
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20210802051255.5771-11-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Bhaumik Bhatt and committed by
Greg Kroah-Hartman
61106bd2 2e36190d

+5 -1
+5 -1
drivers/bus/mhi/core/pm.c
··· 1069 1069 1070 1070 /* Confirm that the device is in valid exec env */ 1071 1071 if (!MHI_IN_PBL(current_ee) && current_ee != MHI_EE_AMSS) { 1072 - dev_err(dev, "Not a valid EE for power on\n"); 1072 + dev_err(dev, "%s is not a valid EE for power on\n", 1073 + TO_MHI_EXEC_STR(current_ee)); 1073 1074 ret = -EIO; 1074 1075 goto error_async_power_up; 1075 1076 } 1076 1077 1077 1078 state = mhi_get_mhi_state(mhi_cntrl); 1079 + dev_dbg(dev, "Attempting power on with EE: %s, state: %s\n", 1080 + TO_MHI_EXEC_STR(current_ee), TO_MHI_STATE_STR(state)); 1081 + 1078 1082 if (state == MHI_STATE_SYS_ERR) { 1079 1083 mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET); 1080 1084 ret = wait_event_timeout(mhi_cntrl->state_event,