From d1c7802611bbbf9c977b6a0a8ccdc178a8fb1fd6 Mon Sep 17 00:00:00 2001 From: Lina Iyer Date: Thu, 5 Sep 2019 15:40:38 -0600 Subject: [PATCH] soc: qcom: rpmh: Fix sending incorrect data during rpmh flush During flush of current cached data, Sleep and Wake TCSes have previously programmed data present. Due to this incorrect data is sent. Fix this by cleaning TCSes and freshly program current cached sleep and wake data. Change-Id: I8f1cb9925a7800aad65d665192d3b129c76dd9de Signed-off-by: Maulik Shah Signed-off-by: Lina Iyer --- drivers/soc/qcom/rpmh.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index 11698a49f513..63db360c19e1 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -562,6 +562,11 @@ int rpmh_flush(const struct device *dev) return 0; } + /* Invalidate the TCSes first to avoid stale data */ + do { + ret = rpmh_rsc_invalidate(ctrlr_to_drv(ctrlr)); + } while (ret == -EAGAIN); + /* First flush the cached batch requests */ ret = flush_batch(ctrlr); if (ret)