[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHLCerPUi-wHo5WTJZZCKS3hmOTs9e+uixudDSRG4jMFukSZeg@mail.gmail.com>
Date: Mon, 23 Nov 2020 01:05:12 +0530
From: Amit Kucheria <amitk@...nel.org>
To: Ansuel Smith <ansuelsmth@...il.com>
Cc: Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Zhang Rui <rui.zhang@...el.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
Linux PM list <linux-pm@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v6 1/8] drivers: thermal: tsens: use get_temp for tsens_valid
Hi Ansuel,
My apologies for being tardy in reviewing this series. Career changes...
On Fri, Aug 14, 2020 at 7:12 PM Ansuel Smith <ansuelsmth@...il.com> wrote:
>
> Use the driver get_temp function instead of force to use the generic get
> temp function. This is needed as tsens v0 version use a custom function
> to get the real temperature.
>
> Signed-off-by: Ansuel Smith <ansuelsmth@...il.com>
> ---
> drivers/thermal/qcom/tsens.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
> index 9af6f71ab640..9fe9a2b26705 100644
> --- a/drivers/thermal/qcom/tsens.c
> +++ b/drivers/thermal/qcom/tsens.c
> @@ -580,7 +580,6 @@ int get_temp_tsens_valid(const struct tsens_sensor *s, int *temp)
> {
> struct tsens_priv *priv = s->priv;
> int hw_id = s->hw_id;
> - u32 temp_idx = LAST_TEMP_0 + hw_id;
> u32 valid_idx = VALID_0 + hw_id;
> u32 valid;
> int ret;
> @@ -600,9 +599,9 @@ int get_temp_tsens_valid(const struct tsens_sensor *s, int *temp)
> }
>
> /* Valid bit is set, OK to read the temperature */
> - *temp = tsens_hw_to_mC(s, temp_idx);
> + ret = priv->ops->get_temp(s, temp);
This is wrong.
.get_temp is set to get_temp_tsens_valid() for v1 and v2 platforms. So
you've just broken all those platforms by creating a recursive loop.
I assume you were trying to use the common interrupt code which
currently uses get_temp_tsens_valid()? I suggest trying to add 8960
support to tsens_hw_to_mC().
>
> - return 0;
> + return ret;
> }
>
> int get_temp_common(const struct tsens_sensor *s, int *temp)
> --
> 2.27.0
>
Powered by blists - more mailing lists