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

Commit 6666e1ec authored by David Dai's avatar David Dai
Browse files

msm: msm_bus: Do not send tcs sets when size is 0



The RPMH driver is returning improper parameters when sending
TCS commands with array sizes 0. This occurs when the delta in a
client's vote is not large enough to cause a change in the threshold
values sent to hardware and causes no changes to the ACTIVE command
sets.

Change-Id: Iac017a26323fb2f453c9e3ef51951f5c106bd671
Signed-off-by: default avatarDavid Dai <daidavid1@codeaurora.org>
parent 2f90dca7
Loading
Loading
Loading
Loading
+24 −18
Original line number Diff line number Diff line
@@ -595,6 +595,9 @@ int msm_bus_commit_data(struct list_head *clist)
		cnt_vcd++;
	}

	if (!cnt_active)
		goto exit_msm_bus_commit_data;

	n_active = kcalloc(cnt_vcd+1, sizeof(int), GFP_KERNEL);
	if (!n_active)
		return -ENOMEM;
@@ -643,32 +646,35 @@ int msm_bus_commit_data(struct list_head *clist)
			MSM_BUS_ERR("%s: error sending active/awake sets: %d\n",
						__func__, ret);
	}

	if (cnt_wake) {
		ret = rpmh_write_passthru(cur_mbox, RPMH_WAKE_ONLY_STATE,
							cmdlist_wake, n_wake);
		if (ret)
			MSM_BUS_ERR("%s: error sending wake sets: %d\n",
							__func__, ret);

	}
	if (cnt_sleep) {
		ret = rpmh_write_passthru(cur_mbox, RPMH_SLEEP_STATE,
							cmdlist_sleep, n_sleep);
		if (ret)
			MSM_BUS_ERR("%s: error sending sleep sets: %d\n",
							__func__, ret);

	list_for_each_entry_safe(node, node_tmp, clist, link) {
		bcm_clist_clean(node);
		node->dirty = false;
		list_del_init(&node->link);
	}

	cur_rsc = NULL;
	kfree(cmdlist_active);
	kfree(cmdlist_wake);
	kfree(cmdlist_sleep);
	kfree(n_active);
	kfree(n_wake);
	kfree(n_sleep);

exit_msm_bus_commit_data:
	list_for_each_entry_safe(node, node_tmp, clist, link) {
		bcm_clist_clean(node);
		node->dirty = false;
		list_del_init(&node->link);
	}
	cur_rsc = NULL;
	return ret;
}