Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d828f95 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: msm_bus: Adjust active and dual votes to prevent double voting"

parents fd32b3b7 9b0a864c
Loading
Loading
Loading
Loading
+26 −21
Original line number Diff line number Diff line
@@ -1782,7 +1782,7 @@ static int update_bw_adhoc(struct msm_bus_client_handle *cl, u64 ab, u64 ib)
	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);

@@ -1803,15 +1803,20 @@ static int update_bw_adhoc(struct msm_bus_client_handle *cl, u64 ab, u64 ib)
	}

	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",
@@ -1820,10 +1825,10 @@ static int update_bw_adhoc(struct msm_bus_client_handle *cl, u64 ab, u64 ib)
	}

	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);
@@ -1835,7 +1840,7 @@ static int update_bw_adhoc(struct msm_bus_client_handle *cl, u64 ab, u64 ib)
}

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;

@@ -1848,18 +1853,18 @@ static int update_bw_context(struct msm_bus_client_handle *cl, u64 act_ab,

	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);
@@ -1868,8 +1873,8 @@ static int update_bw_context(struct msm_bus_client_handle *cl, u64 act_ab,
	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);
+5 −5
Original line number Diff line number Diff line
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -142,17 +142,17 @@ EXPORT_SYMBOL(msm_bus_scale_update_bw);
 * act_ab: The average bandwidth(AB) in Bytes/s to be used in active context.
 * act_ib: The instantaneous bandwidth(IB) in Bytes/s to be used in active
 *         context.
 * slp_ib: The average bandwidth(AB) in Bytes/s to be used in dual context.
 * slp_ab: The instantaneous bandwidth(IB) in Bytes/s to be used in dual
 * dual_ib: The average bandwidth(AB) in Bytes/s to be used in dual context.
 * dual_ab: The instantaneous bandwidth(IB) in Bytes/s to be used in dual
 *         context.
 */
int
msm_bus_scale_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)
{
	if (arb_ops.update_context)
		return arb_ops.update_bw_context(cl, act_ab, act_ib,
							slp_ab, slp_ib);
							dual_ab, dual_ib);

	return -EPROBE_DEFER;
}
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ struct msm_bus_arb_ops {
	int (*update_bw)(struct msm_bus_client_handle *cl, u64 ab, u64 ib);
	void (*unregister)(struct msm_bus_client_handle *cl);
	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 (*query_usecase)(struct msm_bus_tcs_usecase *tcs_usecase,
				uint32_t cl, unsigned int index);
	int (*query_usecase_all)(struct msm_bus_tcs_handle *tcs_handle,
+4 −4
Original line number Diff line number Diff line
@@ -87,8 +87,8 @@ struct msm_bus_client_handle {
	struct device *mas_dev;
	u64 cur_act_ib;
	u64 cur_act_ab;
	u64 cur_slp_ib;
	u64 cur_slp_ab;
	u64 cur_dual_ib;
	u64 cur_dual_ab;
	bool active_only;
};

@@ -125,7 +125,7 @@ msm_bus_scale_register(uint32_t mas, uint32_t slv, char *name,
void msm_bus_scale_unregister(struct msm_bus_client_handle *cl);
int msm_bus_scale_update_bw(struct msm_bus_client_handle *cl, u64 ab, u64 ib);
int msm_bus_scale_update_bw_context(struct msm_bus_client_handle *cl,
		u64 act_ab, u64 act_ib, u64 slp_ib, u64 slp_ab);
		u64 act_ab, u64 act_ib, u64 dual_ib, u64 dual_ab);
int msm_bus_scale_query_tcs_cmd(struct msm_bus_tcs_usecase *tcs_usecase,
					uint32_t cl, unsigned int index);
int msm_bus_scale_query_tcs_cmd_all(struct msm_bus_tcs_handle *tcs_handle,
@@ -192,7 +192,7 @@ msm_bus_scale_update_bw(struct msm_bus_client_handle *cl, u64 ab, u64 ib)

static inline int
msm_bus_scale_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)

{
	return 0;