public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Maulik Shah <mkshah@codeaurora.org>
To: Douglas Anderson <dianders@chromium.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: mka@chromium.org, Lina Iyer <ilina@codeaurora.org>,
	Rajendra Nayak <rnayak@codeaurora.org>,
	swboyd@chromium.org, evgreen@chromium.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 07/10] drivers: qcom: rpmh-rsc: tcs_is_free() can just check tcs_in_use
Date: Wed, 8 Apr 2020 16:55:56 +0530	[thread overview]
Message-ID: <d1f863e3-cc49-3970-7dfd-3cb081bd265c@codeaurora.org> (raw)
In-Reply-To: <20200407164915.v3.7.Icf2213131ea652087f100129359052c83601f8b0@changeid>

Hi,

Reviewed-by: Maulik Shah <mkshah@codeaurora.org>
Tested-by: Maulik Shah <mkshah@codeaurora.org>

Thanks,
Maulik

On 4/8/2020 5:20 AM, Douglas Anderson wrote:
> tcs_is_free() had two checks in it: does the software think that the
> TCS is free and does the hardware think that the TCS is free.  I
> couldn't figure out in which case the hardware could think that a TCS
> was in-use but software thought it was free.  Apparently there is no
> case and the extra check can be removed.  This apparently has already
> been done in a downstream patch.
>
> Suggested-by: Maulik Shah <mkshah@codeaurora.org>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>
> Changes in v3:
> - Replace ("...warn if state mismatch") w/ ("...just check tcs_in_use")
>
> Changes in v2:
> - Comment tcs_is_free() new for v2; replaces old patch 6.
>
>   drivers/soc/qcom/rpmh-rsc.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
> index 84ae3e514eee..9502e7ea96be 100644
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
> @@ -177,7 +177,6 @@ static void write_tcs_reg_sync(struct rsc_drv *drv, int reg, int tcs_id,
>    * @tcs_id: The global ID of this TCS.
>    *
>    * Returns true if nobody has claimed this TCS (by setting tcs_in_use).
> - * If the TCS looks free, checks that the hardware agrees.
>    *
>    * Must be called with the drv->lock held or the tcs_lock for the TCS being
>    * tested. If only the tcs_lock is held then it is possible that this
> @@ -188,8 +187,7 @@ static void write_tcs_reg_sync(struct rsc_drv *drv, int reg, int tcs_id,
>    */
>   static bool tcs_is_free(struct rsc_drv *drv, int tcs_id)
>   {
> -	return !test_bit(tcs_id, drv->tcs_in_use) &&
> -	       read_tcs_reg(drv, RSC_DRV_STATUS, tcs_id);
> +	return !test_bit(tcs_id, drv->tcs_in_use);
>   }
>   
>   /**

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

  reply	other threads:[~2020-04-08 11:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 23:50 [PATCH v3 00/10] drivers: qcom: rpmh-rsc: Cleanup / add lots of comments Douglas Anderson
2020-04-07 23:50 ` [PATCH v3 01/10] drivers: qcom: rpmh-rsc: Clean code reading/writing TCS regs/cmds Douglas Anderson
2020-04-07 23:50 ` [PATCH v3 02/10] drivers: qcom: rpmh-rsc: Document the register layout better Douglas Anderson
2020-04-08 10:59   ` Maulik Shah
2020-04-07 23:50 ` [PATCH v3 03/10] drivers: qcom: rpmh-rsc: Fold tcs_ctrl_write() into its single caller Douglas Anderson
2020-04-07 23:50 ` [PATCH v3 04/10] drivers: qcom: rpmh-rsc: Remove get_tcs_of_type() abstraction Douglas Anderson
2020-04-07 23:50 ` [PATCH v3 05/10] drivers: qcom: rpmh-rsc: Kill cmd_cache and find_match() with fire Douglas Anderson
2020-04-08 11:11   ` Maulik Shah
2020-04-07 23:50 ` [PATCH v3 06/10] drivers: qcom: rpmh-rsc: A lot of comments Douglas Anderson
2020-04-08 11:25   ` Maulik Shah
2020-04-07 23:50 ` [PATCH v3 07/10] drivers: qcom: rpmh-rsc: tcs_is_free() can just check tcs_in_use Douglas Anderson
2020-04-08 11:25   ` Maulik Shah [this message]
2020-04-07 23:50 ` [PATCH v3 08/10] drivers: qcom: rpmh-rsc: Don't double-check rpmh Douglas Anderson
2020-04-08 12:23   ` Maulik Shah
2020-04-09  0:10     ` Doug Anderson
2020-04-07 23:50 ` [PATCH v3 09/10] drivers: qcom: rpmh-rsc: Caller handles tcs_invalidate() exclusivity Douglas Anderson
2020-04-08 13:29   ` Maulik Shah
2020-04-07 23:50 ` [PATCH v3 10/10] drivers: qcom: rpmh-rsc: read_tcs_reg()/write_tcs_reg() are not for IRQ Douglas Anderson
2020-04-08 13:32   ` 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=d1f863e3-cc49-3970-7dfd-3cb081bd265c@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=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