lkml.org 
[lkml]   [2020]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] soc: qcom: rpmh: Dirt can only make you dirtier, not cleaner
On Fri 17 Apr 14:15 PDT 2020, Douglas Anderson wrote:

> Adding an item into the cache should never be able to make the cache
> cleaner. Use "|=" rather than "=" to update the dirty flag.
>

This is correct...

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> Fixes: bb7000677a1b ("soc: qcom: rpmh: Update dirty flag only when data changes")
> Reported-by: Stephen Boyd <swboyd@chromium.org>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>
> drivers/soc/qcom/rpmh.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c
> index 3abbb08cd6e1..d1626a1328d7 100644
> --- a/drivers/soc/qcom/rpmh.c
> +++ b/drivers/soc/qcom/rpmh.c
> @@ -151,10 +151,10 @@ static struct cache_req *cache_rpm_request(struct rpmh_ctrlr *ctrlr,
> break;
> }
>
> - ctrlr->dirty = (req->sleep_val != old_sleep_val ||
> - req->wake_val != old_wake_val) &&
> - req->sleep_val != UINT_MAX &&
> - req->wake_val != UINT_MAX;
> + ctrlr->dirty |= (req->sleep_val != old_sleep_val ||
> + req->wake_val != old_wake_val) &&
> + req->sleep_val != UINT_MAX &&
> + req->wake_val != UINT_MAX;

...but this logic says dirty "if either sleep or wake has changed and
both sleep and wake are requested".

So what if we have an entry with only sleep wake changed, then the
controller won't be dirty and hence the hardware won't know about this
request - until another "fully specified" request comes in, which would
cause the controller to be dirty and flush out the "partially specified"
request as well.

Is this really the expected behavior?

Regards,
Bjorn

>
> unlock:
> spin_unlock_irqrestore(&ctrlr->cache_lock, flags);
> --
> 2.26.1.301.g55bc3eb7cb9-goog
>

\
 
 \ /
  Last update: 2020-04-20 22:31    [W:0.055 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site