mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Douglas Anderson <dianders@chromium.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: mkshah@codeaurora.org, mka@chromium.org, swboyd@chromium.org,
	evgreen@chromium.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soc: qcom: rpmh-rsc: Factor "tcs_reg_addr" and "tcs_cmd_addr" calculation
Date: Tue, 14 Apr 2020 10:56:20 -0700	[thread overview]
Message-ID: <9c633ea161df91265a338aaa93a78443894c268f.camel@perches.com> (raw)
In-Reply-To: <20200414104120.1.Ic70288f256ff0be65cac6a600367212dfe39f6c9@changeid>

On Tue, 2020-04-14 at 10:41 -0700, Douglas Anderson wrote:
> We can make some of the register access functions more readable by
> factoring out the calculations a little bit.

unrelated trivia:

> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
[]
>  static void write_tcs_reg_sync(struct rsc_drv *drv, int reg, int tcs_id,
>  			       u32 data)
>  {
> -	writel(data, drv->tcs_base + RSC_DRV_TCS_OFFSET * tcs_id + reg);
> +	writel(data, tcs_reg_addr(drv, reg, tcs_id));
>  	for (;;) {
> -		if (data == readl(drv->tcs_base + reg +
> -				  RSC_DRV_TCS_OFFSET * tcs_id))
> +		if (data == readl(tcs_reg_addr(drv, reg, tcs_id)))
>  			break;
>  		udelay(1);
>  	}

There a lockup potential here.

It might be better to use some max loop counter with
an error/warning emitted instead of a continuous retry.



  reply	other threads:[~2020-04-14 17:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 17:41 Douglas Anderson
2020-04-14 17:56 ` Joe Perches [this message]
2020-04-14 18:46   ` Doug Anderson
2020-04-14 19:44 ` Stephen Boyd

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=9c633ea161df91265a338aaa93a78443894c268f.camel@perches.com \
    --to=joe@perches.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=evgreen@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=mkshah@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

all inboxes | Powered by JetHome®