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 <cpratapa@codeaurora.org>
This commit is contained in:
Chaitanya Pratapa 2019-10-17 13:42:57 -07:00 • committed by Gerrit - the friendly Code Review server
commit c4e75e2793

View file

@ -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;