[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9c633ea161df91265a338aaa93a78443894c268f.camel@perches.com>
Date: Tue, 14 Apr 2020 10:56:20 -0700
From: Joe Perches <joe@...ches.com>
To: Douglas Anderson <dianders@...omium.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: mkshah@...eaurora.org, mka@...omium.org, swboyd@...omium.org,
evgreen@...omium.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] soc: qcom: rpmh-rsc: Factor "tcs_reg_addr" and
"tcs_cmd_addr" calculation
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.
Powered by blists - more mailing lists