From: Stephen Boyd <swboyd@chromium.org>
To: Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Douglas Anderson <dianders@chromium.org>,
Maulik Shah <mkshah@codeaurora.org>
Cc: mka@chromium.org, Rajendra Nayak <rnayak@codeaurora.org>,
evgreen@chromium.org, Lina Iyer <ilina@codeaurora.org>,
Douglas Anderson <dianders@chromium.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 05/10] drivers: qcom: rpmh-rsc: Kill cmd_cache and find_match() with fire
Date: Mon, 13 Apr 2020 14:41:35 -0700 [thread overview]
Message-ID: <158681409564.84447.15749412606958274934@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <20200413100321.v4.5.I6d3d0a3ec810dc72ff1df3cbf97deefdcdeb8eef@changeid>
Quoting Douglas Anderson (2020-04-13 10:04:10)
> The "cmd_cache" in RPMH wasn't terribly sensible. Specifically:
>
> - The current code doesn't realy detect "conflicts" properly any case
s/realy/really/
> where the sequence being checked has more than one entry. One
> simple way to see this in the current code is that if cmd[0].addr
> isn't found that cmd[1].addr is never checked.
s/that/then/ ?
> - The code attempted to use the "cmd_cache" to update an existing
> message in a sleep/wake TCS with new data. The goal appeared to be
> to update part of a TCS while leaving the rest of the TCS alone. We
> never actually do this. We always fully invalidate and re-write
> everything.
> - If/when we try to optimize things to not fully invalidate / re-write
> every time we update the TCSes we'll need to think it through very
> carefully. Specifically requirement of find_match() that the new
> sequence of addrs must match exactly the old sequence of addrs seems
> inflexible. It's also not documented in rpmh_write() and
> rpmh_write_batch(). In any case, if we do decide to require updates
> to keep the exact same sequence and length then presumably the API
> and data structures should be updated to understand groups more
> properly. The current algorithm doesn't really keep track of the
> length of the old sequence and there are several boundary-condition
> bugs because of that. Said another way: if we decide to do
> something like this in the future we should start from scratch and
> thus find_match() isn't useful to keep around.
>
> This patch isn't quite a no-op. Specifically:
>
> - It should be a slight performance boost of not searching through so
> many arrays.
> - The old code would have done something useful in one case: it would
> allow someone calling rpmh_write() to override the data that came
> from rpmh_write_batch(). I don't believe that actually happens in
> reality.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> Reviewed-by: Maulik Shah <mkshah@codeaurora.org>
> Tested-by: Maulik Shah <mkshah@codeaurora.org>
> ---
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
next prev parent reply other threads:[~2020-04-13 21:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-13 17:04 [PATCH v4 00/10] drivers: qcom: rpmh-rsc: Cleanup / add lots of comments Douglas Anderson
2020-04-13 17:04 ` [PATCH v4 01/10] drivers: qcom: rpmh-rsc: Clean code reading/writing TCS regs/cmds Douglas Anderson
2020-04-13 18:19 ` Joe Perches
2020-04-13 21:18 ` Doug Anderson
2020-04-13 21:33 ` Joe Perches
2020-04-14 17:43 ` Doug Anderson
2020-04-13 21:20 ` Stephen Boyd
2020-04-13 17:04 ` [PATCH v4 02/10] drivers: qcom: rpmh-rsc: Document the register layout better Douglas Anderson
2020-04-13 21:23 ` Stephen Boyd
2020-04-13 17:04 ` [PATCH v4 03/10] drivers: qcom: rpmh-rsc: Fold tcs_ctrl_write() into its single caller Douglas Anderson
2020-04-13 21:36 ` Stephen Boyd
2020-04-13 17:04 ` [PATCH v4 04/10] drivers: qcom: rpmh-rsc: Remove get_tcs_of_type() abstraction Douglas Anderson
2020-04-13 21:37 ` Stephen Boyd
2020-04-13 17:04 ` [PATCH v4 05/10] drivers: qcom: rpmh-rsc: Kill cmd_cache and find_match() with fire Douglas Anderson
2020-04-13 21:41 ` Stephen Boyd [this message]
2020-04-13 17:04 ` [PATCH v4 06/10] drivers: qcom: rpmh-rsc: A lot of comments Douglas Anderson
2020-04-13 21:58 ` Stephen Boyd
2020-04-13 17:04 ` [PATCH v4 07/10] drivers: qcom: rpmh-rsc: tcs_is_free() can just check tcs_in_use Douglas Anderson
2020-04-13 21:58 ` Stephen Boyd
2020-04-13 17:04 ` [PATCH v4 08/10] drivers: qcom: rpmh-rsc: Don't double-check rpmh payload Douglas Anderson
2020-04-13 23:02 ` Stephen Boyd
2020-04-13 17:04 ` [PATCH v4 09/10] drivers: qcom: rpmh-rsc: Caller handles tcs_invalidate() exclusivity Douglas Anderson
2020-04-13 23:03 ` Stephen Boyd
2020-04-13 17:04 ` [PATCH v4 10/10] drivers: qcom: rpmh-rsc: read_tcs_reg()/write_tcs_reg() are not for IRQ Douglas Anderson
2020-04-13 23:03 ` Stephen Boyd
2020-04-14 5:28 ` [PATCH v4 00/10] drivers: qcom: rpmh-rsc: Cleanup / add lots of comments Bjorn Andersson
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=158681409564.84447.15749412606958274934@swboyd.mtv.corp.google.com \
--to=swboyd@chromium.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=mka@chromium.org \
--cc=mkshah@codeaurora.org \
--cc=rnayak@codeaurora.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).