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

Commit aaf0183b authored by Maulik Shah's avatar Maulik Shah
Browse files

drivers: soc: qcom: rpmh: Correctly set dirty flag



Currently rpmh dirty flag is set for all cases regardless of
data is really updated or not. Correct it to update for
only those cases where data is updated.

Change-Id: I2c87ffbf1bae23ddd4b4cb7dced213cac267df59
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent 594a477d
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -257,21 +257,28 @@ static struct rpmh_req *cache_rpm_request(struct rpmh_client *rc,
	switch (state) {
	case RPMH_ACTIVE_ONLY_STATE:
	case RPMH_AWAKE_STATE:
		if (req->sleep_val != UINT_MAX)
		if (req->sleep_val != UINT_MAX) {
			req->wake_val = cmd->data;
			rpm->dirty = true;
		}
		break;
	case RPMH_WAKE_ONLY_STATE:
		if (req->wake_val != cmd->data) {
			req->wake_val = cmd->data;
			rpm->dirty = true;
		}
		break;
	case RPMH_SLEEP_STATE:
		if (req->sleep_val != cmd->data) {
			req->sleep_val = cmd->data;
			rpm->dirty = true;
		}
		break;
	default:
		break;
	};

unlock:
	rpm->dirty = true;
	spin_unlock_irqrestore(&rpm->lock, flags);

	return req;