From e58916c5d53bcc1d680f6b753cc9ccfc4c0bd826 Mon Sep 17 00:00:00 2001 From: Bojun Pan Date: Thu, 18 Jul 2019 12:21:50 -0700 Subject: [PATCH] msm: IPA: mhi_proxy: correct the return for mhi unvote on ssr When 4G ssr happens, imp will unregister the mhi. And if the devote request from Q6 we would need to ignore it. The current handling is to just ignore this QMI request but if Q6 shutdown is not happen on time there would be a QMI assert happen on Q6 side. The fix here is to still response to QMI with error imcompatiable. Change-Id: I51637181a428a96fcd4385bcb1573acbff808813 Signed-off-by: Bojun Pan --- drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c | 11 +++++++++++ drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c b/drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c index 6cd91a2c8c30..b768750ac515 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c @@ -610,6 +610,17 @@ struct ipa_mhi_clk_vote_resp_msg_v01 resp->resp.error = IPA_QMI_ERR_INCOMPATIBLE_STATE_V01; mutex_lock(&imp_ctx->mutex); + + /* + * returning success for clock unvote request - since it could + * be 5G modem SSR scenario where clocks are already OFF. + */ + if (!vote && imp_ctx->state == IMP_INVALID) { + IMP_DBG("Unvote in Invalid state, no op for clock unvote\n"); + mutex_unlock(&imp_ctx->mutex); + return resp; + } + if (imp_ctx->state != IMP_STARTED) { IMP_ERR("unexpected vote when in state %d\n", imp_ctx->state); mutex_unlock(&imp_ctx->mutex); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c index 9617b6b369c5..bec091db12b5 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c @@ -388,7 +388,7 @@ static void ipa3_handle_mhi_vote_req(struct qmi_handle *qmi_handle, } else { resp = imp_handle_vote_req(vote_req->mhi_vote); if (!resp) { - IPAWANERR("imp handle allocate channel req fails"); + IPAWANERR("imp handle vote req fails\n"); return; } IPAWANDBG("start sending QMI_IPA_MHI_CLK_VOTE_RESP_V01\n");