msm: mhi_dev: Add an option to not timeout waiting for M0

On certain platforms host might take a long time to send M0
to device. Only modified msm files in this commit.

Change-Id: I8c5f07a7926e01afa84a983ef98721749787d2da
Signed-off-by: Siva Kumar Akkireddi <sivaa@codeaurora.org>
Signed-off-by: Gauri Joshi <gaurjosh@codeaurora.org>
This commit is contained in:
Gauri Joshi 2020-04-17 00:30:28 +05:30
commit c17f1783a6
2 changed files with 9 additions and 1 deletions

View file

@ -3355,7 +3355,8 @@ static void mhi_dev_enable(struct work_struct *work)
"Cleared reset before waiting for M0\n");
}
while (state != MHI_DEV_M0_STATE && max_cnt < MHI_SUSPEND_TIMEOUT) {
while (state != MHI_DEV_M0_STATE &&
((max_cnt < MHI_SUSPEND_TIMEOUT) || mhi->no_m0_timeout)) {
/* Wait for Host to set the M0 state */
msleep(MHI_SUSPEND_MIN);
rc = mhi_dev_mmio_get_mhi_state(mhi, &state, &mhi_reset);
@ -3624,6 +3625,9 @@ static int get_device_tree_data(struct platform_device *pdev)
mhi->enable_m2 = of_property_read_bool((&pdev->dev)->of_node,
"qcom,enable-m2");
mhi->no_m0_timeout = of_property_read_bool((&pdev->dev)->of_node,
"qcom,no-m0-timeout");
mhi_log(MHI_MSG_VERBOSE, "acquiring wakelock\n");
return 0;

View file

@ -595,9 +595,13 @@ struct mhi_dev {
/*Register for interrupt*/
bool mhi_int;
bool mhi_int_en;
/* Enable M2 autonomous mode from MHI */
bool enable_m2;
/* Dont timeout waiting for M0 */
bool no_m0_timeout;
/* Registered client callback list */
struct list_head client_cb_list;
/* Tx, Rx DMA channels */