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: Maulik Shah <mkshah@codeaurora.org>
This commit is contained in:
Maulik Shah 2018-06-29 11:19:18 +05:30
commit 800b8a605c

View file

@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */
#include <linux/atomic.h>
#include <linux/bug.h>
@ -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:
req->wake_val = cmd->data;
if (req->wake_val != cmd->data) {
req->wake_val = cmd->data;
ctrlr->dirty = true;
}
break;
case RPMH_SLEEP_STATE:
req->sleep_val = cmd->data;
if (req->sleep_val != cmd->data) {
req->sleep_val = cmd->data;
ctrlr->dirty = true;
}
break;
default:
break;
}
ctrlr->dirty = true;
unlock:
spin_unlock_irqrestore(&ctrlr->cache_lock, flags);