From 133f74939dec62763e7bf5601f0be7afa89db949 Mon Sep 17 00:00:00 2001 From: Vevek Venkatesan Date: Wed, 4 Sep 2019 15:38:25 +0530 Subject: [PATCH] qcacld-3.0: set same IPA bandwidth for both cons and prod pipes Set the same IPA bandwidth for both the cons and prod pipes based on total packet counts, to avoid overwrite voting by one another, as per IPA-PM implementation. Change-Id: I5f93e1ff91f9fbeb42ea8bd93792e288a073b6b1 CRs-Fixed: 2521811 --- ipa/core/src/wlan_ipa_rm.c | 41 +++++++++++++------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/ipa/core/src/wlan_ipa_rm.c b/ipa/core/src/wlan_ipa_rm.c index 97af0b3171..da47ecc5df 100644 --- a/ipa/core/src/wlan_ipa_rm.c +++ b/ipa/core/src/wlan_ipa_rm.c @@ -27,54 +27,41 @@ QDF_STATUS wlan_ipa_set_perf_level(struct wlan_ipa_priv *ipa_ctx, uint64_t tx_packets, uint64_t rx_packets) { - uint32_t next_cons_bw, next_prod_bw; int ret; + uint32_t next_bw; + uint64_t total_packets = tx_packets + rx_packets; if ((!wlan_ipa_is_enabled(ipa_ctx->config)) || (!wlan_ipa_is_clk_scaling_enabled(ipa_ctx->config))) return 0; - if (tx_packets > (ipa_ctx->config->bus_bw_high / 2)) - next_cons_bw = ipa_ctx->config->ipa_bw_high; - else if (tx_packets > (ipa_ctx->config->bus_bw_medium / 2)) - next_cons_bw = ipa_ctx->config->ipa_bw_medium; + if (total_packets > (ipa_ctx->config->bus_bw_high / 2)) + next_bw = ipa_ctx->config->ipa_bw_high; + else if (total_packets > (ipa_ctx->config->bus_bw_medium / 2)) + next_bw = ipa_ctx->config->ipa_bw_medium; else - next_cons_bw = ipa_ctx->config->ipa_bw_low; + next_bw = ipa_ctx->config->ipa_bw_low; - if (rx_packets > (ipa_ctx->config->bus_bw_high / 2)) - next_prod_bw = ipa_ctx->config->ipa_bw_high; - else if (rx_packets > (ipa_ctx->config->bus_bw_medium / 2)) - next_prod_bw = ipa_ctx->config->ipa_bw_medium; - else - next_prod_bw = ipa_ctx->config->ipa_bw_low; - - if (ipa_ctx->curr_cons_bw != next_cons_bw) { - ipa_debug("Requesting CONS perf curr: %d, next: %d", - ipa_ctx->curr_cons_bw, next_cons_bw); + if (ipa_ctx->curr_cons_bw != next_bw) { + ipa_debug("Requesting IPA perf curr: %d, next: %d", + ipa_ctx->curr_cons_bw, next_bw); ret = cdp_ipa_set_perf_level(ipa_ctx->dp_soc, QDF_IPA_CLIENT_WLAN1_CONS, - next_cons_bw); + next_bw); if (ret) { ipa_err("RM CONS set perf profile failed: %d", ret); return QDF_STATUS_E_FAILURE; } - ipa_ctx->curr_cons_bw = next_cons_bw; - ipa_ctx->stats.num_cons_perf_req++; - } - - if (ipa_ctx->curr_prod_bw != next_prod_bw) { - ipa_debug("Requesting PROD perf curr: %d, next: %d", - ipa_ctx->curr_prod_bw, next_prod_bw); ret = cdp_ipa_set_perf_level(ipa_ctx->dp_soc, QDF_IPA_CLIENT_WLAN1_PROD, - next_prod_bw); + next_bw); if (ret) { ipa_err("RM PROD set perf profile failed: %d", ret); return QDF_STATUS_E_FAILURE; } - ipa_ctx->curr_prod_bw = next_prod_bw; - ipa_ctx->stats.num_prod_perf_req++; + ipa_ctx->curr_cons_bw = next_bw; + ipa_ctx->stats.num_cons_perf_req++; } return QDF_STATUS_SUCCESS;