Commit d5e20507 authored by Maulik Shah's avatar Maulik Shah Committed by Bjorn Andersson

drivers: qcom: rpmh: remove rpmh_flush export

rpmh_flush() was exported with the idea that an external entity
operation during CPU idle would know when to flush the sleep and wake
TCS. Since, this is not the case when defining a power domain for the
RSC. Remove the function export and instead allow the function to be
called internally.
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/1580736940-6985-3-git-send-email-mkshah@codeaurora.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent aff9cc08
...@@ -110,5 +110,6 @@ int rpmh_rsc_write_ctrl_data(struct rsc_drv *drv, ...@@ -110,5 +110,6 @@ int rpmh_rsc_write_ctrl_data(struct rsc_drv *drv,
int rpmh_rsc_invalidate(struct rsc_drv *drv); int rpmh_rsc_invalidate(struct rsc_drv *drv);
void rpmh_tx_done(const struct tcs_request *msg, int r); void rpmh_tx_done(const struct tcs_request *msg, int r);
int rpmh_flush(struct rpmh_ctrlr *ctrlr);
#endif /* __RPM_INTERNAL_H__ */ #endif /* __RPM_INTERNAL_H__ */
...@@ -427,11 +427,10 @@ static int is_req_valid(struct cache_req *req) ...@@ -427,11 +427,10 @@ static int is_req_valid(struct cache_req *req)
req->sleep_val != req->wake_val); req->sleep_val != req->wake_val);
} }
static int send_single(const struct device *dev, enum rpmh_state state, static int send_single(struct rpmh_ctrlr *ctrlr, enum rpmh_state state,
u32 addr, u32 data) u32 addr, u32 data)
{ {
DEFINE_RPMH_MSG_ONSTACK(dev, state, NULL, rpm_msg); DEFINE_RPMH_MSG_ONSTACK(NULL, state, NULL, rpm_msg);
struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev);
/* Wake sets are always complete and sleep sets are not */ /* Wake sets are always complete and sleep sets are not */
rpm_msg.msg.wait_for_compl = (state == RPMH_WAKE_ONLY_STATE); rpm_msg.msg.wait_for_compl = (state == RPMH_WAKE_ONLY_STATE);
...@@ -445,7 +444,7 @@ static int send_single(const struct device *dev, enum rpmh_state state, ...@@ -445,7 +444,7 @@ static int send_single(const struct device *dev, enum rpmh_state state,
/** /**
* rpmh_flush: Flushes the buffered active and sleep sets to TCS * rpmh_flush: Flushes the buffered active and sleep sets to TCS
* *
* @dev: The device making the request * @ctrlr: controller making request to flush cached data
* *
* Return: -EBUSY if the controller is busy, probably waiting on a response * Return: -EBUSY if the controller is busy, probably waiting on a response
* to a RPMH request sent earlier. * to a RPMH request sent earlier.
...@@ -454,10 +453,9 @@ static int send_single(const struct device *dev, enum rpmh_state state, ...@@ -454,10 +453,9 @@ static int send_single(const struct device *dev, enum rpmh_state state,
* that is powering down the entire system. Since no other RPMH API would be * that is powering down the entire system. Since no other RPMH API would be
* executing at this time, it is safe to run lockless. * executing at this time, it is safe to run lockless.
*/ */
int rpmh_flush(const struct device *dev) int rpmh_flush(struct rpmh_ctrlr *ctrlr)
{ {
struct cache_req *p; struct cache_req *p;
struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev);
int ret; int ret;
if (!ctrlr->dirty) { if (!ctrlr->dirty) {
...@@ -480,11 +478,12 @@ int rpmh_flush(const struct device *dev) ...@@ -480,11 +478,12 @@ int rpmh_flush(const struct device *dev)
__func__, p->addr, p->sleep_val, p->wake_val); __func__, p->addr, p->sleep_val, p->wake_val);
continue; continue;
} }
ret = send_single(dev, RPMH_SLEEP_STATE, p->addr, p->sleep_val); ret = send_single(ctrlr, RPMH_SLEEP_STATE, p->addr,
p->sleep_val);
if (ret) if (ret)
return ret; return ret;
ret = send_single(dev, RPMH_WAKE_ONLY_STATE, ret = send_single(ctrlr, RPMH_WAKE_ONLY_STATE, p->addr,
p->addr, p->wake_val); p->wake_val);
if (ret) if (ret)
return ret; return ret;
} }
...@@ -493,7 +492,6 @@ int rpmh_flush(const struct device *dev) ...@@ -493,7 +492,6 @@ int rpmh_flush(const struct device *dev)
return 0; return 0;
} }
EXPORT_SYMBOL(rpmh_flush);
/** /**
* rpmh_invalidate: Invalidate all sleep and active sets * rpmh_invalidate: Invalidate all sleep and active sets
......
...@@ -20,8 +20,6 @@ int rpmh_write_async(const struct device *dev, enum rpmh_state state, ...@@ -20,8 +20,6 @@ int rpmh_write_async(const struct device *dev, enum rpmh_state state,
int rpmh_write_batch(const struct device *dev, enum rpmh_state state, int rpmh_write_batch(const struct device *dev, enum rpmh_state state,
const struct tcs_cmd *cmd, u32 *n); const struct tcs_cmd *cmd, u32 *n);
int rpmh_flush(const struct device *dev);
int rpmh_invalidate(const struct device *dev); int rpmh_invalidate(const struct device *dev);
#else #else
...@@ -40,9 +38,6 @@ static inline int rpmh_write_batch(const struct device *dev, ...@@ -40,9 +38,6 @@ static inline int rpmh_write_batch(const struct device *dev,
const struct tcs_cmd *cmd, u32 *n) const struct tcs_cmd *cmd, u32 *n)
{ return -ENODEV; } { return -ENODEV; }
static inline int rpmh_flush(const struct device *dev)
{ return -ENODEV; }
static inline int rpmh_invalidate(const struct device *dev) static inline int rpmh_invalidate(const struct device *dev)
{ return -ENODEV; } { return -ENODEV; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment