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

Commit 3864d223 authored by Maulik Shah's avatar Maulik Shah Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: rpmh: Fix sending incorrect data during flush



During flush of current cached data, Sleep and Wake TCSes have
previously programmed data present. Due to this incorrect data
is sent.

Fix this by cleaning TCSes and freshly program current cached
sleep and wake data.

Change-Id: I8f1cb9925a7800aad65d665192d3b129c76dd9de
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent db2e9767
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2019, 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
@@ -908,6 +908,7 @@ int send_single(struct rpmh_client *rc, enum rpmh_state state, u32 addr,
 */
int rpmh_flush(struct rpmh_client *rc)
{
	DEFINE_RPMH_MSG_ONSTACK(rc, 0, NULL, NULL, rpm_msg);
	struct rpmh_req *p;
	struct rpmh_mbox *rpm = rc->rpmh;
	int ret;
@@ -930,6 +931,13 @@ int rpmh_flush(struct rpmh_client *rc)
	}
	spin_unlock_irqrestore(&rpm->lock, flags);

	/* Invalidate sleep and wake TCS */
	rpm_msg.msg.invalidate = true;
	rpm_msg.msg.is_complete = false;
	ret = mbox_write_controller_data(rc->chan, &rpm_msg.msg);
	if (ret)
		return ret;

	/* First flush the cached passthru's */
	ret = flush_passthru(rc);
	if (ret)