[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1582793785-22423-4-git-send-email-mkshah@codeaurora.org>
Date: Thu, 27 Feb 2020 14:26:25 +0530
From: Maulik Shah <mkshah@...eaurora.org>
To: swboyd@...omium.org, mka@...omium.org, evgreen@...omium.org,
bjorn.andersson@...aro.org
Cc: linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
agross@...nel.org, dianders@...omium.org, rnayak@...eaurora.org,
ilina@...eaurora.org, lsrao@...eaurora.org,
Maulik Shah <mkshah@...eaurora.org>
Subject: [PATCH v8 3/3] soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches
Add changes to invoke rpmh flush() when the data in cache is dirty.
This is done only if OSI is not supported in PSCI. If OSI is supported
rpmh_flush can get invoked when the last cpu going to power collapse
deepest low power mode.
Also remove "depends on COMPILE_TEST" for Kconfig option QCOM_RPMH so the
driver is only compiled for arm64 which supports psci_has_osi_support()
API.
Signed-off-by: Maulik Shah <mkshah@...eaurora.org>
Reviewed-by: Srinivas Rao L <lsrao@...eaurora.org>
---
drivers/soc/qcom/Kconfig | 2 +-
drivers/soc/qcom/rpmh.c | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index d0a73e7..2e581bc 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -105,7 +105,7 @@ config QCOM_RMTFS_MEM
config QCOM_RPMH
bool "Qualcomm RPM-Hardened (RPMH) Communication"
- depends on ARCH_QCOM && ARM64 || COMPILE_TEST
+ depends on ARCH_QCOM && ARM64
help
Support for communication with the hardened-RPM blocks in
Qualcomm Technologies Inc (QTI) SoCs. RPMH communication uses an
diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c
index 3f5d9eb..326c58a 100644
--- a/drivers/soc/qcom/rpmh.c
+++ b/drivers/soc/qcom/rpmh.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
+#include <linux/psci.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
@@ -160,6 +161,9 @@ static struct cache_req *cache_rpm_request(struct rpmh_ctrlr *ctrlr,
unlock:
spin_unlock_irqrestore(&ctrlr->cache_lock, flags);
+ if (ctrlr->dirty && !psci_has_osi_support())
+ return rpmh_flush(ctrlr) ? ERR_PTR(-EINVAL) : req;
+
return req;
}
@@ -388,6 +392,8 @@ int rpmh_write_batch(const struct device *dev, enum rpmh_state state,
if (state != RPMH_ACTIVE_ONLY_STATE) {
cache_batch(ctrlr, req);
+ if (!psci_has_osi_support())
+ return rpmh_flush(ctrlr);
return 0;
}
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
Powered by blists - more mailing lists