From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: rafael@kernel.org, daniel.lezcano@linaro.org,
rui.zhang@intel.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH] thermal/drivers/qoriq: fix getting tmu range
Date: Thu, 11 Jan 2024 10:56:39 +0100 [thread overview]
Message-ID: <ZZ-7V2bGL3c1RuZw@pengutronix.de> (raw)
In-Reply-To: <20231020081337.3141488-1-peng.fan@oss.nxp.com>
Hi Peng,
On Fri, Oct 20, 2023 at 04:13:37PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> TMU Version 1 has 4 TTRCRs, while TMU Version >=2 has 16 TTRCRs.
> So limit the len to 4 will report "invalid range data" for i.MX93.
>
> This patch drop the local array with allocated ttrcr array and
> able to support larger tmu ranges.
>
> Fixes: f12d60c81fce ("thermal/drivers/qoriq: Support version 2.1")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/thermal/qoriq_thermal.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
> index ccc2eea7f9f5..404f01cca4da 100644
> --- a/drivers/thermal/qoriq_thermal.c
> +++ b/drivers/thermal/qoriq_thermal.c
> @@ -57,6 +57,9 @@
> #define REGS_TTRnCR(n) (0xf10 + 4 * (n)) /* Temperature Range n
> * Control Register
> */
> +#define NUM_TTRCR_V1 4
> +#define NUM_TTRCR_MAX 16
> +
> #define REGS_IPBRR(n) (0xbf8 + 4 * (n)) /* IP Block Revision
> * Register n
> */
> @@ -71,6 +74,7 @@ struct qoriq_sensor {
>
> struct qoriq_tmu_data {
> int ver;
> + u32 ttrcr[NUM_TTRCR_MAX];
> struct regmap *regmap;
> struct clk *clk;
> struct qoriq_sensor sensor[SITES_MAX];
> @@ -182,17 +186,17 @@ static int qoriq_tmu_calibration(struct device *dev,
> struct qoriq_tmu_data *data)
> {
> int i, val, len;
> - u32 range[4];
Why don't you keep the array locally on the stack? Will it be needed
elsewhere later?
Other than that:
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Would be great if this could be picked up anytime soon.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2024-01-11 9:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 8:13 [PATCH] thermal/drivers/qoriq: fix getting tmu range Peng Fan (OSS)
2024-01-11 9:56 ` Sascha Hauer [this message]
2024-01-11 10:47 ` Peng Fan
2024-01-25 11:07 ` Peng Fan
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=ZZ-7V2bGL3c1RuZw@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
/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