lkml.org 
[lkml]   [2020]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFT PATCH v2 07/10] drivers: qcom: rpmh-rsc: Warning if tcs_write() used for non-active
Date
tcs_write() is documented to only be useful for writing
RPMH_ACTIVE_ONLY_STATE. Let's be loud if someone messes up.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

Changes in v2: None

drivers/soc/qcom/rpmh-rsc.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index 93f5d1fb71ca..ba489d18c20e 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -573,6 +573,12 @@ static int tcs_write(struct rsc_drv *drv, const struct tcs_request *msg)
unsigned long flags;
int ret;

+ /*
+ * It only makes sense to grab a whole TCS for ourselves if we're
+ * triggering right away, which we only do for ACTIVE_ONLY.
+ */
+ WARN_ON(msg->state != RPMH_ACTIVE_ONLY_STATE);
+
/* TODO: get_tcs_for_msg() can return -EAGAIN and nobody handles */
tcs = get_tcs_for_msg(drv, msg);
if (IS_ERR(tcs))
--
2.25.1.481.gfbce0eb801-goog
\
 
 \ /
  Last update: 2020-03-12 00:14    [W:0.206 / U:2.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site