Skip to contentSkip to conversation

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

PATCH Superseded Bhaumik Bhatt 2 participants 2 messages Apr 27, 2021 – May 1, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus: mhi: core: Improve debug messages for power on

Improve error message to be more descriptive if a failure occurs with an invalid power on execution environment. Also add a debug message to print the execution environment and MHI state before a power on is attempted to get a better view of device states.

---
 drivers/bus/mhi/core/pm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/bus/mhi/core/pm.c +5 -1
index adf426c..f4a8b9a 100644
@@ -1076,12 +1076,16 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
 
 	/* Confirm that the device is in valid exec env */
 	if (!MHI_IN_PBL(current_ee) && current_ee != MHI_EE_AMSS) {
-		dev_err(dev, "Not a valid EE for power on\n");
+		dev_err(dev, "%s is not a valid EE for power on\n",
+			TO_MHI_EXEC_STR(current_ee));
 		ret = -EIO;
 		goto error_async_power_up;
 	}
 
 	state = mhi_get_mhi_state(mhi_cntrl);
+	dev_dbg(dev, "Attempting power on with EE: %s, state: %s\n",
+		TO_MHI_EXEC_STR(current_ee), TO_MHI_STATE_STR(state));
+
 	if (state == MHI_STATE_SYS_ERR) {
 		mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET);
 		ret = wait_event_timeout(mhi_cntrl->state_event,
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

Hi Bhaumik,

Quoted 4 lines · Bhaumik Bhatt

Improve error message to be more descriptive if a failure occurs with an invalid power on execution environment. Also add a debug message to print the execution environment and MHI state before a power on is attempted to get a better view of device states.

Can we add a scenario where this dbg log can help ? That gives a good justification for addition of new log.

Quoted 19 lines
---
  drivers/bus/mhi/core/pm.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
drivers/bus/mhi/core/pm.c +2 -1
index adf426c..f4a8b9a 100644
@@ -1076,12 +1076,16 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
 
  	/* Confirm that the device is in valid exec env */
  	if (!MHI_IN_PBL(current_ee) && current_ee != MHI_EE_AMSS) {
-		dev_err(dev, "Not a valid EE for power on\n");
+		dev_err(dev, "%s is not a valid EE for power on\n",
+			TO_MHI_EXEC_STR(current_ee));
  		ret = -EIO;

drivers/bus/mhi/core/pm.c int mhi_async_power_up(struct mhi_controller *mhi_cntrl) · line 1091

Quoted 10 lines
drivers/bus/mhi/core/pm.c +3 -0
  		goto error_async_power_up;
  	}
 
  	state = mhi_get_mhi_state(mhi_cntrl);
+	dev_dbg(dev, "Attempting power on with EE: %s, state: %s\n",
+		TO_MHI_EXEC_STR(current_ee), TO_MHI_STATE_STR(state));
+
  	if (state == MHI_STATE_SYS_ERR) {
  		mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET);
  		ret = wait_event_timeout(mhi_cntrl->state_event,

Thanks,
Hemant

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project