* [PATCH v2] thermal: rcar_gen3_thermal: improve logging during probe
@ 2022-06-09 20:07 Wolfram Sang
2022-06-10 8:04 ` Geert Uytterhoeven
2022-06-10 13:00 ` Niklas Söderlund
0 siblings, 2 replies; 5+ messages in thread
From: Wolfram Sang @ 2022-06-09 20:07 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Niklas Söderlund, Rafael J. Wysocki,
Daniel Lezcano, Amit Kucheria, Zhang Rui, linux-pm, linux-kernel
When setting up a new board, a plain "Can't register thermal zone"
didn't help me much because the thermal zones in DT were all fine. I
just had a sensor entry too much in the parent TSC node. Reword the
failure/success messages to contain the sensor number to make it easier
to understand which sensor is affected. Example output now:
rcar_gen3_thermal e6198000.thermal: Sensor 0: Loaded 1 trip point
rcar_gen3_thermal e6198000.thermal: Sensor 1: Loaded 1 trip point
rcar_gen3_thermal e6198000.thermal: Sensor 2: Loaded 1 trip point
rcar_gen3_thermal e6198000.thermal: Sensor 3: Can't register thermal zone
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Change from v1: reword the dev_info string to be more like the original
one. Added a check to add the plural-'s' only when needed.
Geert: is this better now?
drivers/thermal/rcar_gen3_thermal.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
index ccdf8a24ddc7..f7357b5bd506 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -511,7 +511,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
zone = devm_thermal_zone_of_sensor_register(dev, i, tsc,
&rcar_gen3_tz_of_ops);
if (IS_ERR(zone)) {
- dev_err(dev, "Can't register thermal zone\n");
+ dev_err(dev, "Sensor %u: Can't register thermal zone\n", i);
ret = PTR_ERR(zone);
goto error_unregister;
}
@@ -533,7 +533,8 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
if (ret < 0)
goto error_unregister;
- dev_info(dev, "TSC%u: Loaded %d trip points\n", i, ret);
+ dev_info(dev, "Sensor %u: Loaded %u trip point%s\n", i, ret,
+ ret == 1 ? "" : "s");
}
if (!priv->num_tscs) {
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] thermal: rcar_gen3_thermal: improve logging during probe
2022-06-09 20:07 [PATCH v2] thermal: rcar_gen3_thermal: improve logging during probe Wolfram Sang
@ 2022-06-10 8:04 ` Geert Uytterhoeven
2022-06-10 13:00 ` Niklas Söderlund
1 sibling, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2022-06-10 8:04 UTC (permalink / raw)
To: Wolfram Sang
Cc: Linux-Renesas, Niklas Söderlund, Rafael J. Wysocki,
Daniel Lezcano, Amit Kucheria, Zhang Rui, Linux PM list,
Linux Kernel Mailing List
Hi Wolfram,
On Thu, Jun 9, 2022 at 10:23 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> When setting up a new board, a plain "Can't register thermal zone"
> didn't help me much because the thermal zones in DT were all fine. I
> just had a sensor entry too much in the parent TSC node. Reword the
> failure/success messages to contain the sensor number to make it easier
> to understand which sensor is affected. Example output now:
>
> rcar_gen3_thermal e6198000.thermal: Sensor 0: Loaded 1 trip point
> rcar_gen3_thermal e6198000.thermal: Sensor 1: Loaded 1 trip point
> rcar_gen3_thermal e6198000.thermal: Sensor 2: Loaded 1 trip point
> rcar_gen3_thermal e6198000.thermal: Sensor 3: Can't register thermal zone
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Change from v1: reword the dev_info string to be more like the original
> one. Added a check to add the plural-'s' only when needed.
Thanks for the update!
> Geert: is this better now?
Much better!
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] thermal: rcar_gen3_thermal: improve logging during probe
2022-06-09 20:07 [PATCH v2] thermal: rcar_gen3_thermal: improve logging during probe Wolfram Sang
2022-06-10 8:04 ` Geert Uytterhoeven
@ 2022-06-10 13:00 ` Niklas Söderlund
2022-06-10 13:06 ` Wolfram Sang
1 sibling, 1 reply; 5+ messages in thread
From: Niklas Söderlund @ 2022-06-10 13:00 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Rafael J. Wysocki, Daniel Lezcano,
Amit Kucheria, Zhang Rui, linux-pm, linux-kernel
Hi Wolfram,
Thanks for your work.
On 2022-06-09 22:07:09 +0200, Wolfram Sang wrote:
> When setting up a new board, a plain "Can't register thermal zone"
> didn't help me much because the thermal zones in DT were all fine. I
> just had a sensor entry too much in the parent TSC node. Reword the
> failure/success messages to contain the sensor number to make it easier
> to understand which sensor is affected. Example output now:
>
> rcar_gen3_thermal e6198000.thermal: Sensor 0: Loaded 1 trip point
> rcar_gen3_thermal e6198000.thermal: Sensor 1: Loaded 1 trip point
> rcar_gen3_thermal e6198000.thermal: Sensor 2: Loaded 1 trip point
> rcar_gen3_thermal e6198000.thermal: Sensor 3: Can't register thermal zone
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Change from v1: reword the dev_info string to be more like the original
> one. Added a check to add the plural-'s' only when needed.
>
> Geert: is this better now?
>
> drivers/thermal/rcar_gen3_thermal.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
> index ccdf8a24ddc7..f7357b5bd506 100644
> --- a/drivers/thermal/rcar_gen3_thermal.c
> +++ b/drivers/thermal/rcar_gen3_thermal.c
> @@ -511,7 +511,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
> zone = devm_thermal_zone_of_sensor_register(dev, i, tsc,
> &rcar_gen3_tz_of_ops);
> if (IS_ERR(zone)) {
> - dev_err(dev, "Can't register thermal zone\n");
> + dev_err(dev, "Sensor %u: Can't register thermal zone\n", i);
> ret = PTR_ERR(zone);
> goto error_unregister;
> }
> @@ -533,7 +533,8 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
> if (ret < 0)
> goto error_unregister;
>
> - dev_info(dev, "TSC%u: Loaded %d trip points\n", i, ret);
> + dev_info(dev, "Sensor %u: Loaded %u trip point%s\n", i, ret,
> + ret == 1 ? "" : "s");
Bikeshedding, I'm not keen on this style as it makes it harder IMHO to
grep for log strings in the code. But I don't dislike it enough to ask
you to change it ;-) So if you and Geert are happy with this style,
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Do feel free to keep the tag if you send a version without the plural
special case.
> }
>
> if (!priv->num_tscs) {
> --
> 2.35.1
>
--
Kind Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] thermal: rcar_gen3_thermal: improve logging during probe
2022-06-10 13:00 ` Niklas Söderlund
@ 2022-06-10 13:06 ` Wolfram Sang
2022-06-10 15:50 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2022-06-10 13:06 UTC (permalink / raw)
To: Niklas Söderlund
Cc: linux-renesas-soc, Rafael J. Wysocki, Daniel Lezcano,
Amit Kucheria, Zhang Rui, linux-pm, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 277 bytes --]
> Bikeshedding, I'm not keen on this style as it makes it harder IMHO to
> grep for log strings in the code. But I don't dislike it enough to ask
> you to change it ;-) So if you and Geert are happy with this style,
Seems reasonable to me, Geert what do you think?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] thermal: rcar_gen3_thermal: improve logging during probe
2022-06-10 13:06 ` Wolfram Sang
@ 2022-06-10 15:50 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2022-06-10 15:50 UTC (permalink / raw)
To: Wolfram Sang, Niklas Söderlund, Linux-Renesas,
Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
Linux PM list, Linux Kernel Mailing List
Hi Wolfram,
On Fri, Jun 10, 2022 at 3:13 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> > Bikeshedding, I'm not keen on this style as it makes it harder IMHO to
> > grep for log strings in the code. But I don't dislike it enough to ask
> > you to change it ;-) So if you and Geert are happy with this style,
>
> Seems reasonable to me, Geert what do you think?
I plead guilty, too, as my OCD cannot stand those plural/singular
mismatches ;-)
But Niklas does have a valid point...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-10 15:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 20:07 [PATCH v2] thermal: rcar_gen3_thermal: improve logging during probe Wolfram Sang
2022-06-10 8:04 ` Geert Uytterhoeven
2022-06-10 13:00 ` Niklas Söderlund
2022-06-10 13:06 ` Wolfram Sang
2022-06-10 15:50 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).