msm: msm_bus: Adjust active and dual votes to prevent double voting
Sleep votes are currently treated as dual context votes with the
rpmh iteration of the bus driver, change update_bw_adhoc to clear
active ib/ab votes from non active only clients to prevent
a double bandwidth vote. Rename slp_ib/slp_ab to dual_ib/dual_ab
to better describe its purpose.
Change-Id: I838b547521c3597016744b06e34224b5b8c092ba
Signed-off-by: David Dai <daidavid1@codeaurora.org>
diff --git a/drivers/soc/qcom/msm_bus/msm_bus_arb_rpmh.c b/drivers/soc/qcom/msm_bus/msm_bus_arb_rpmh.c
index aa6c5d7..bcaeca5 100644
--- a/drivers/soc/qcom/msm_bus/msm_bus_arb_rpmh.c
+++ b/drivers/soc/qcom/msm_bus/msm_bus_arb_rpmh.c
@@ -1794,7 +1794,7 @@
int ret = 0;
char *test_cl = "test-client";
bool log_transaction = false;
- u64 slp_ib, slp_ab;
+ u64 dual_ib, dual_ab, act_ib, act_ab;
rt_mutex_lock(&msm_bus_adhoc_lock);
@@ -1815,15 +1815,20 @@
}
if (cl->active_only) {
- slp_ib = 0;
- slp_ab = 0;
+ act_ib = ib;
+ act_ab = ab;
+ dual_ib = 0;
+ dual_ab = 0;
} else {
- slp_ib = ib;
- slp_ab = ab;
+ dual_ib = ib;
+ dual_ab = ab;
+ act_ib = 0;
+ act_ab = 0;
}
- ret = update_path(cl->mas_dev, cl->slv, ib, ab, slp_ib, slp_ab,
- cl->cur_act_ib, cl->cur_act_ab, cl->first_hop, cl->active_only);
+ ret = update_path(cl->mas_dev, cl->slv, act_ib, act_ab, dual_ib,
+ dual_ab, cl->cur_act_ib, cl->cur_act_ab, cl->first_hop,
+ cl->active_only);
if (ret) {
MSM_BUS_ERR("%s: Update path failed! %d active_only %d\n",
@@ -1832,10 +1837,10 @@
}
commit_data();
- cl->cur_act_ib = ib;
- cl->cur_act_ab = ab;
- cl->cur_slp_ib = slp_ib;
- cl->cur_slp_ab = slp_ab;
+ cl->cur_act_ib = act_ib;
+ cl->cur_act_ab = act_ab;
+ cl->cur_dual_ib = dual_ib;
+ cl->cur_dual_ab = dual_ab;
if (log_transaction)
getpath_debug(cl->mas, cl->first_hop, cl->active_only);
@@ -1847,7 +1852,7 @@
}
static int update_bw_context(struct msm_bus_client_handle *cl, u64 act_ab,
- u64 act_ib, u64 slp_ib, u64 slp_ab)
+ u64 act_ib, u64 dual_ib, u64 dual_ab)
{
int ret = 0;
@@ -1860,18 +1865,18 @@
if ((cl->cur_act_ib == act_ib) &&
(cl->cur_act_ab == act_ab) &&
- (cl->cur_slp_ib == slp_ib) &&
- (cl->cur_slp_ab == slp_ab)) {
+ (cl->cur_dual_ib == dual_ib) &&
+ (cl->cur_dual_ab == dual_ab)) {
MSM_BUS_ERR("No change in vote");
goto exit_change_context;
}
- if (!slp_ab && !slp_ib)
+ if (!dual_ab && !dual_ib)
cl->active_only = true;
- msm_bus_dbg_rec_transaction(cl, cl->cur_act_ab, cl->cur_slp_ib);
- ret = update_path(cl->mas_dev, cl->slv, act_ib, act_ab, slp_ib, slp_ab,
- cl->cur_act_ab, cl->cur_act_ab, cl->first_hop,
- cl->active_only);
+ msm_bus_dbg_rec_transaction(cl, cl->cur_act_ab, cl->cur_dual_ib);
+ ret = update_path(cl->mas_dev, cl->slv, act_ib, act_ab, dual_ib,
+ dual_ab, cl->cur_act_ab, cl->cur_act_ab,
+ cl->first_hop, cl->active_only);
if (ret) {
MSM_BUS_ERR("%s: Update path failed! %d active_only %d\n",
__func__, ret, cl->active_only);
@@ -1880,8 +1885,8 @@
commit_data();
cl->cur_act_ib = act_ib;
cl->cur_act_ab = act_ab;
- cl->cur_slp_ib = slp_ib;
- cl->cur_slp_ab = slp_ab;
+ cl->cur_dual_ib = dual_ib;
+ cl->cur_dual_ab = dual_ab;
// trace_bus_update_request_end(cl->name);
exit_change_context:
rt_mutex_unlock(&msm_bus_adhoc_lock);