From 5ed3cc3fcdf29066cd633c436034cd5167a3a492 Mon Sep 17 00:00:00 2001 From: Ashok Vuyyuru Date: Mon, 12 Oct 2020 11:24:41 +0530 Subject: [PATCH] msm: ipa3: Send enable force clear only for producer pipe Enable forceclear only supported for producer pipe so avoid sending the force clear command to consumer pipes. Signed-off-by: Ashok Vuyyuru Change-Id: I850f360f18c6598af6914c9cd2c89cacad1ac4c9 --- drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c | 36 ++++++++++--------- drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c | 34 +++++++++--------- drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c | 34 +++++++++--------- 3 files changed, 55 insertions(+), 49 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c index 1260c115afb1..6905fd163476 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c @@ -2636,23 +2636,25 @@ int ipa3_suspend_gsi_wdi_pipe(u32 clnt_hdl) } if (ep->valid) { IPADBG("suspended pipe %d\n", ipa_ep_idx); - source_pipe_bitmask = 1 << - ipa3_get_ep_mapping(ep->client); - res = ipa3_enable_force_clear(clnt_hdl, - false, source_pipe_bitmask); - if (res) { - /* - * assuming here modem SSR, AP can remove - * the delay in this case - */ - IPAERR("failed to force clear %d\n", res); - IPAERR("remove delay from SCND reg\n"); - ep_ctrl_scnd.endp_delay = false; - ipahal_write_reg_n_fields( - IPA_ENDP_INIT_CTRL_SCND_n, clnt_hdl, - &ep_ctrl_scnd); - } else { - disable_force_clear = true; + if (IPA_CLIENT_IS_PROD(ep->client)) { + source_pipe_bitmask = 1 << + ipa3_get_ep_mapping(ep->client); + res = ipa3_enable_force_clear(clnt_hdl, + false, source_pipe_bitmask); + if (res) { + /* + * assuming here modem SSR, AP can remove + * the delay in this case + */ + IPAERR("failed to force clear %d\n", res); + IPAERR("remove delay from SCND reg\n"); + ep_ctrl_scnd.endp_delay = false; + ipahal_write_reg_n_fields( + IPA_ENDP_INIT_CTRL_SCND_n, clnt_hdl, + &ep_ctrl_scnd); + } else { + disable_force_clear = true; + } } retry_gsi_stop: res = ipa3_stop_gsi_channel(ipa_ep_idx); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c b/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c index aa7f27bb041e..8288d77831a4 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c @@ -962,23 +962,25 @@ int ipa3_disable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx) * as IPA uC will fail to suspend the pipe otherwise. */ ep = &ipa3_ctx->ep[ipa_ep_idx_rx]; - source_pipe_bitmask = 1 << + if (IPA_CLIENT_IS_PROD(ep->client)) { + source_pipe_bitmask = 1 << ipa3_get_ep_mapping(ep->client); - result = ipa3_enable_force_clear(ipa_ep_idx_rx, - false, source_pipe_bitmask); - if (result) { - /* - * assuming here modem SSR, AP can remove - * the delay in this case - */ - IPAERR("failed to force clear %d\n", result); - IPAERR("remove delay from SCND reg\n"); - ep_ctrl_scnd.endp_delay = false; - ipahal_write_reg_n_fields( - IPA_ENDP_INIT_CTRL_SCND_n, ipa_ep_idx_rx, - &ep_ctrl_scnd); - } else { - disable_force_clear = true; + result = ipa3_enable_force_clear(ipa_ep_idx_rx, + false, source_pipe_bitmask); + if (result) { + /* + * assuming here modem SSR, AP can remove + * the delay in this case + */ + IPAERR("failed to force clear %d\n", result); + IPAERR("remove delay from SCND reg\n"); + ep_ctrl_scnd.endp_delay = false; + ipahal_write_reg_n_fields( + IPA_ENDP_INIT_CTRL_SCND_n, ipa_ep_idx_rx, + &ep_ctrl_scnd); + } else { + disable_force_clear = true; + } } /* stop gsi rx channel */ diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c b/drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c index 2aca4cbba146..e50a93c281c1 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c @@ -1809,22 +1809,24 @@ int ipa3_disable_wigig_pipe_i(enum ipa_client_type client) } IPADBG("pipe %d\n", ipa_ep_idx); - source_pipe_bitmask = 1 << ipa_ep_idx; - res = ipa3_enable_force_clear(ipa_ep_idx, - false, source_pipe_bitmask); - if (res) { - /* - * assuming here modem SSR, AP can remove - * the delay in this case - */ - IPAERR("failed to force clear %d\n", res); - IPAERR("remove delay from SCND reg\n"); - ep_ctrl_scnd.endp_delay = false; - ipahal_write_reg_n_fields( - IPA_ENDP_INIT_CTRL_SCND_n, ipa_ep_idx, - &ep_ctrl_scnd); - } else { - disable_force_clear = true; + if (IPA_CLIENT_IS_PROD(ep->client)) { + source_pipe_bitmask = 1 << ipa_ep_idx; + res = ipa3_enable_force_clear(ipa_ep_idx, + false, source_pipe_bitmask); + if (res) { + /* + * assuming here modem SSR, AP can remove + * the delay in this case + */ + IPAERR("failed to force clear %d\n", res); + IPAERR("remove delay from SCND reg\n"); + ep_ctrl_scnd.endp_delay = false; + ipahal_write_reg_n_fields( + IPA_ENDP_INIT_CTRL_SCND_n, ipa_ep_idx, + &ep_ctrl_scnd); + } else { + disable_force_clear = true; + } } retry_gsi_stop: res = ipa3_stop_gsi_channel(ipa_ep_idx);