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

Commit c0fb8230 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 bc904ccd
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -175,20 +175,27 @@ static struct cache_req *cache_rpm_request(struct rpmh_ctrlr *ctrlr,
existing:
	switch (state) {
	case RPMH_ACTIVE_ONLY_STATE:
		if (req->sleep_val != UINT_MAX)
		if (req->sleep_val != UINT_MAX) {
			req->wake_val = cmd->data;
			ctrlr->dirty = true;
		}
		break;
	case RPMH_WAKE_ONLY_STATE:
		if (req->wake_val != cmd->data) {
			req->wake_val = cmd->data;
			ctrlr->dirty = true;
		}
		break;
	case RPMH_SLEEP_STATE:
		if (req->sleep_val != cmd->data) {
			req->sleep_val = cmd->data;
			ctrlr->dirty = true;
		}
		break;
	default:
		break;
	}

	ctrlr->dirty = true;
unlock:
	spin_unlock(&ctrlr->cache_lock);