[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8402789.eFmWaWnqpD@diego>
Date: Mon, 18 Aug 2025 20:44:15 +0200
From: Heiko StĂĽbner <heiko@...ech.de>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>,
Lukasz Luba <lukasz.luba@....com>,
Sebastian Reichel <sebastian.reichel@...labora.com>
Cc: linux-pm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel@...labora.com, Sebastian Reichel <sebastian.reichel@...labora.com>
Subject: Re: [PATCH] thermal: rockchip: shut up GRF warning
Hi Sebastian,
Am Montag, 18. August 2025, 19:26:15 Mitteleuropäische Sommerzeit schrieb Sebastian Reichel:
> Most of the recent Rockchip devices do not have a GRF associated
> with the tsadc IP. Let's avoid printing a warning on those devices.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@...labora.com>
thanks a lot for tracking down the GRF usage for all the soc variants :-)
> ---
> drivers/thermal/rockchip_thermal.c | 53 +++++++++++++++++++++++++++++++++-----
> 1 file changed, 46 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
> index 3beff9b6fac3abe8948b56132b618ff1bed57217..1e8091cebd6673ab39fa0c4dee835c68aeb7e8b5 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -1099,6 +1114,8 @@ static const struct rockchip_tsadc_chip px30_tsadc_data = {
> .chn_offset = 0,
> .chn_num = 2, /* 2 channels for tsadc */
>
> + .grf_mode = GRF_MANDATORY,
> +
> .tshut_mode = TSHUT_MODE_CRU, /* default TSHUT via CRU */
> .tshut_temp = 95000,
>
> @@ -1123,6 +1140,8 @@ static const struct rockchip_tsadc_chip rv1108_tsadc_data = {
> .chn_offset = 0,
> .chn_num = 1, /* one channel for tsadc */
>
> + .grf_mode = GRF_NONE,
> +
nit: I guess instead of adding an empty line, you could also just drop
the empty line above, to bring the "older" variants into the form
rk3576 and rk3588 use.
> .tshut_mode = TSHUT_MODE_GPIO, /* default TSHUT via GPIO give PMIC */
> .tshut_polarity = TSHUT_LOW_ACTIVE, /* default TSHUT LOW ACTIVE */
> .tshut_temp = 95000,
[...]
> @@ -1321,6 +1354,7 @@ static const struct rockchip_tsadc_chip rk3576_tsadc_data = {
> /* top, big_core, little_core, ddr, npu, gpu */
> .chn_offset = 0,
> .chn_num = 6, /* six channels for tsadc */
> + .grf_mode = GRF_NONE,
> .tshut_mode = TSHUT_MODE_GPIO, /* default TSHUT via GPIO give PMIC */
> .tshut_polarity = TSHUT_LOW_ACTIVE, /* default TSHUT LOW ACTIVE */
> .tshut_temp = 95000,
> @@ -1345,6 +1379,7 @@ static const struct rockchip_tsadc_chip rk3588_tsadc_data = {
> /* top, big_core0, big_core1, little_core, center, gpu, npu */
> .chn_offset = 0,
> .chn_num = 7, /* seven channels for tsadc */
> + .grf_mode = GRF_NONE,
> .tshut_mode = TSHUT_MODE_GPIO, /* default TSHUT via GPIO give PMIC */
> .tshut_polarity = TSHUT_LOW_ACTIVE, /* default TSHUT LOW ACTIVE */
> .tshut_temp = 95000,
[...]
> @@ -1621,12 +1656,16 @@ static int rockchip_configure_from_dt(struct device *dev,
> return -EINVAL;
> }
>
> - /* The tsadc wont to handle the error in here since some SoCs didn't
> - * need this property.
> - */
> - thermal->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
> - if (IS_ERR(thermal->grf))
> - dev_warn(dev, "Missing rockchip,grf property\n");
> + if (thermal->chip->grf_mode != GRF_NONE) {
> + thermal->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
> + if (IS_ERR(thermal->grf)) {
> + ret = PTR_ERR(thermal->grf);
> + if (thermal->chip->grf_mode == GRF_OPTIONAL)
> + dev_warn(dev, "Missing rockchip,grf property\n");
I guess it might make it easier for people seeing the log, if we could
insert an "optional" into that message for the optional tier.
> + else
> + return dev_err_probe(dev, ret, "Missing rockchip,grf property\n");
> + }
> + }
>
> rockchip_get_trim_configuration(dev, np, thermal);
Overall, though
Reviewed-by: Heiko Stuebner <heiko@...ech.de>
Thanks
Heiko
Powered by blists - more mailing lists