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

Commit 50614cec authored by Lina Iyer's avatar Lina Iyer Committed by Gerrit - the friendly Code Review server
Browse files

drivers: qcom: rpmh: Setup wake requests as 'complete'



Since wake requests should guarantee that the requested resources are in
the required state before the processor is run, setup the wake set
requests as 'complete'. Sleep requests need not be setup as 'complete'.

Also remove the unnecessary check in __rpmh_write(), since we will never
write sleep and wake requests to the controller at that time.

Change-Id: I66790e514b118e2668f5546e616a015c3dcb1108
Signed-off-by: default avatarLina Iyer <ilina@codeaurora.org>
parent 28c53e7c
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -899,11 +899,6 @@ static int chan_tcs_ctrl_write(struct mbox_chan *chan, void *data)
		goto tx_done;
	}

	if (msg->is_complete) {
		dev_err(dev, "Incorrect ctrl request.\n");
		goto tx_done;
	}

	/* Post the message to the TCS without trigger */
	ret = tcs_mbox_write(chan, msg, false);

+2 −11
Original line number Diff line number Diff line
@@ -245,16 +245,6 @@ int __rpmh_write(struct rpmh_client *rc, enum rpmh_state state,
	int ret = 0;
	int i;

	/*
	 * We cannot wait for completion for a sleep set, its done
	 * outside the processor.
	 */
	if (rpm_msg->msg.is_complete &&
		(state == RPMH_SLEEP_STATE || state == RPMH_WAKE_ONLY_STATE)) {
		pr_err("Mismatch: sleep/wake set with completion.\n");
		return -EINVAL;
	}

	/* Cache the request in our store and link the payload */
	for (i = 0; i < rpm_msg->msg.num_payload; i++) {
		req = cache_rpm_request(rc, state, &rpm_msg->msg.payload[i]);
@@ -638,7 +628,8 @@ int send_single(struct rpmh_client *rc, enum rpmh_state state, u32 addr,
{
	DEFINE_RPMH_MSG_ONSTACK(rc, state, NULL, NULL, rpm_msg);

	rpm_msg.msg.is_complete = false;
	/* Wake sets are always complete and sleep sets are not */
	rpm_msg.msg.is_complete = (state == RPMH_WAKE_ONLY_STATE);
	rpm_msg.cmd.addr = addr;
	rpm_msg.cmd.data = data;