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

Commit ba629954 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: Shrink number of batches sent to Rpmh" into msm-4.14

parents 127ddf7c 91f10380
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -450,6 +450,23 @@ static int bcm_clist_add(struct msm_bus_node_device_type *cur_dev)
	return ret;
}

static void tcs_cmd_n_shrink(int *n)
{
	int i = 0, j = 0, sum = 0;

	do {
		if (sum + n[i] > MAX_RPMH_PAYLOAD) {
			n[j] = sum;
			sum = 0;
			j++;
		}
		sum += n[i];
	} while (n[i++]);

	n[j] = sum;
	n[j+1] = 0;
}

static int bcm_query_list_add(struct msm_bus_node_device_type *cur_dev)
{
	int ret = 0;
@@ -591,6 +608,10 @@ int msm_bus_commit_data(struct list_head *clist)
	bcm_cnt = tcs_cmd_list_gen(n_active, n_wake, n_sleep, cmdlist_active,
				cmdlist_wake, cmdlist_sleep, cur_bcm_clist);

	tcs_cmd_n_shrink(n_active);
	tcs_cmd_n_shrink(n_wake);
	tcs_cmd_n_shrink(n_sleep);

	ret = rpmh_invalidate(cur_mbox);
	if (ret)
		MSM_BUS_ERR("%s: Error invalidating mbox: %d\n",