From: Maulik Shah <mkshah@codeaurora.org>
To: Stephen Boyd <swboyd@chromium.org>,
bjorn.andersson@linaro.org, dianders@chromium.org,
evgreen@chromium.org
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
agross@kernel.org, mka@chromium.org, rnayak@codeaurora.org,
ilina@codeaurora.org, lsrao@codeaurora.org
Subject: Re: [PATCH v16 3/6] soc: qcom: rpmh: Invalidate SLEEP and WAKE TCSes before flushing new data
Date: Sun, 12 Apr 2020 18:55:22 +0530 [thread overview]
Message-ID: <69028d69-0a11-3ceb-afe1-25171b8718cd@codeaurora.org> (raw)
In-Reply-To: <158646379456.77611.8638840660664120750@swboyd.mtv.corp.google.com>
Hi,
On 4/10/2020 1:53 AM, Stephen Boyd wrote:
> Quoting Maulik Shah (2020-04-05 23:32:18)
>> TCSes have previously programmed data when rpmh_flush is called.
> rpmh_flush()
Ok, i will update in v17.
>
>> This can cause old data to trigger along with newly flushed.
>>
>> Fix this by cleaning SLEEP and WAKE TCSes before new data is flushed.
>>
>> With this there is no need to invoke rpmh_rsc_invalidate() call from
>> rpmh_invalidate().
>>
>> Simplify rpmh_invalidate() by moving invalidate_batch() inside.
>>
>> Fixes: 600513dfeef3 ("drivers: qcom: rpmh: cache sleep/wake state requests")
>> Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
>> Reviewed-by: Douglas Anderson <dianders@chromium.org>
>> ---
>> drivers/soc/qcom/rpmh.c | 41 ++++++++++++++++++-----------------------
>> 1 file changed, 18 insertions(+), 23 deletions(-)
>>
>> diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c
>> index 03630ae..a75f3df 100644
>> --- a/drivers/soc/qcom/rpmh.c
>> +++ b/drivers/soc/qcom/rpmh.c
>> @@ -498,24 +492,25 @@ int rpmh_flush(struct rpmh_ctrlr *ctrlr)
>> }
>>
>> /**
>> - * rpmh_invalidate: Invalidate all sleep and active sets
>> - * sets.
>> + * rpmh_invalidate: Invalidate sleep and wake sets in batch_cache
>> *
>> * @dev: The device making the request
>> *
>> - * Invalidate the sleep and active values in the TCS blocks.
>> + * Invalidate the sleep and wake values in batch_cache.
>> */
>> int rpmh_invalidate(const struct device *dev)
>> {
>> struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev);
>> - int ret;
>> -
>> - invalidate_batch(ctrlr);
>> + struct batch_cache_req *req, *tmp;
>> + unsigned long flags;
>>
>> - do {
>> - ret = rpmh_rsc_invalidate(ctrlr_to_drv(ctrlr));
>> - } while (ret == -EAGAIN);
>> + spin_lock_irqsave(&ctrlr->cache_lock, flags);
>> + list_for_each_entry_safe(req, tmp, &ctrlr->batch_cache, list)
>> + kfree(req);
>> + INIT_LIST_HEAD(&ctrlr->batch_cache);
>> + ctrlr->dirty = true;
>> + spin_unlock_irqrestore(&ctrlr->cache_lock, flags);
>>
>> - return ret;
>> + return 0;
> Now this always returns 0. Maybe it should become a void function, but
> doing that requires a change in the interconnect code so maybe do it
> later.
Sure i will add in my To-Do list.
Thanks,
Maulik
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
next prev parent reply other threads:[~2020-04-12 13:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 6:32 [PATCH v16 0/6] Invoke rpmh_flush for non OSI targets Maulik Shah
2020-04-06 6:32 ` [PATCH v16 1/6] arm64: dts: qcom: sc7180: Add cpuidle low power states Maulik Shah
2020-04-06 6:32 ` [PATCH v16 2/6] soc: qcom: rpmh: Update dirty flag only when data changes Maulik Shah
2020-04-06 6:32 ` [PATCH v16 3/6] soc: qcom: rpmh: Invalidate SLEEP and WAKE TCSes before flushing new data Maulik Shah
2020-04-09 20:23 ` Stephen Boyd
2020-04-12 13:25 ` Maulik Shah [this message]
2020-04-06 6:32 ` [PATCH v16 4/6] soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches Maulik Shah
2020-04-08 2:50 ` Stephen Boyd
2020-04-08 7:08 ` Maulik Shah
2020-04-09 8:16 ` Stephen Boyd
2020-04-12 13:51 ` Maulik Shah
2020-04-10 4:15 ` Stephen Boyd
2020-04-10 14:52 ` Doug Anderson
2020-04-12 14:10 ` Maulik Shah
2020-04-12 14:04 ` Maulik Shah
2020-04-06 6:32 ` [PATCH v16 5/6] soc: qcom: rpmh-rsc: Clear active mode configuration for wake TCS Maulik Shah
2020-04-06 6:32 ` [PATCH v16 6/6] soc: qcom: rpmh-rsc: Allow using free WAKE TCS for active request Maulik Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=69028d69-0a11-3ceb-afe1-25171b8718cd@codeaurora.org \
--to=mkshah@codeaurora.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=dianders@chromium.org \
--cc=evgreen@chromium.org \
--cc=ilina@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lsrao@codeaurora.org \
--cc=mka@chromium.org \
--cc=rnayak@codeaurora.org \
--cc=swboyd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).