From da797fd8ed856b72c67c8564eea6b1481c782e8e Mon Sep 17 00:00:00 2001 From: Michael Adisumarta Date: Wed, 14 Mar 2018 10:44:53 -0700 Subject: [PATCH] msm: ipa4: halt both q6 channels for IPAv4 Add a flag in hal_q6_channel to halt both consumer and producer channels. Halt both q6 channels starting from IPAv4. Change-Id: I1f62e08d9709389fe52968bcbbf7d782786be1ab Crs:fixed: 2203488 Signed-off-by: Michael Adisumarta --- drivers/platform/msm/ipa/ipa_v3/ipa.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c index 80edd9500fa2..cc8233002af4 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c @@ -2109,7 +2109,7 @@ static void ipa3_q6_avoid_holb(void) } } -static void ipa3_halt_q6_cons_gsi_channels(void) +static void ipa3_halt_q6_gsi_channels(bool prod) { int ep_idx; int client_idx; @@ -2118,8 +2118,10 @@ static void ipa3_halt_q6_cons_gsi_channels(void) int ret; int code = 0; + /* if prod flag is true, then we halt the producer channels also */ for (client_idx = 0; client_idx < IPA_CLIENT_MAX; client_idx++) { - if (IPA_CLIENT_IS_Q6_CONS(client_idx)) { + if (IPA_CLIENT_IS_Q6_CONS(client_idx) + || (IPA_CLIENT_IS_Q6_PROD(client_idx) && prod)) { ep_idx = ipa3_get_ep_mapping(client_idx); if (ep_idx == -1) continue; @@ -2161,7 +2163,6 @@ static void ipa3_halt_q6_cons_gsi_channels(void) } } - static int ipa3_q6_clean_q6_flt_tbls(enum ipa_ip_type ip, enum ipa_rule_type rlt) { @@ -2577,6 +2578,7 @@ void ipa3_q6_post_shutdown_cleanup(void) { int client_idx; int ep_idx; + bool prod = false; IPADBG_LOW("ENTER\n"); @@ -2589,7 +2591,17 @@ void ipa3_q6_post_shutdown_cleanup(void) /* Handle the issue where SUSPEND was removed for some reason */ ipa3_q6_avoid_holb(); - ipa3_halt_q6_cons_gsi_channels(); + + /* halt both prod and cons channels starting at IPAv4 */ + if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { + prod = true; + ipa3_halt_q6_gsi_channels(prod); + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); + IPADBG("Exit without consumer check\n"); + return; + } + + ipa3_halt_q6_gsi_channels(prod); for (client_idx = 0; client_idx < IPA_CLIENT_MAX; client_idx++) if (IPA_CLIENT_IS_Q6_PROD(client_idx)) {