From c4e75e2793f65d3600528015aa46f551d4fa9aae Mon Sep 17 00:00:00 2001 From: Chaitanya Pratapa Date: Thu, 17 Oct 2019 13:42:57 -0700 Subject: [PATCH] msm: ipa: Fix not to update state during pipe reset When MHI pipes are disconnected, host doesn't expect any further communication from device. Make a change to not to update the state during pipe disconnect. Change-Id: Ia2315e3a94049ba3adda4b42d363ce2f7108d89f Signed-off-by: Chaitanya Pratapa --- drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c b/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c index 9bf586f59d36..483b02bd3874 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c @@ -1288,7 +1288,8 @@ static int ipa_mhi_reset_dl_channel(struct ipa_mhi_channel_ctx *channel) return 0; } -static int ipa_mhi_reset_channel(struct ipa_mhi_channel_ctx *channel) +static int ipa_mhi_reset_channel(struct ipa_mhi_channel_ctx *channel, + bool update_state) { int res; @@ -1304,7 +1305,8 @@ static int ipa_mhi_reset_channel(struct ipa_mhi_channel_ctx *channel) channel->state = IPA_HW_MHI_CHANNEL_STATE_DISABLE; - if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) { + if ((ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) && + update_state) { res = ipa_mhi_read_write_host(IPA_MHI_DMA_TO_HOST, &channel->state, channel->channel_context_addr + offsetof(struct ipa_mhi_ch_ctx, chstate), @@ -1468,7 +1470,7 @@ int ipa_mhi_connect_pipe(struct ipa_mhi_connect_params *in, u32 *clnt_hdl) return 0; fail_connect_pipe: mutex_unlock(&mhi_client_general_mutex); - ipa_mhi_reset_channel(channel); + ipa_mhi_reset_channel(channel, true); fail_start_channel: IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client); return -EPERM; @@ -1516,7 +1518,7 @@ int ipa_mhi_disconnect_pipe(u32 clnt_hdl) IPA_ACTIVE_CLIENTS_INC_EP(ipa_get_client_mapping(clnt_hdl)); - res = ipa_mhi_reset_channel(channel); + res = ipa_mhi_reset_channel(channel, false); if (res) { IPA_MHI_ERR("ipa_mhi_reset_channel failed %d\n", res); goto fail_reset_channel;