diff mbox series

thermal: core: Print out thermal zone name on update_temperature error

Message ID 20231218-topic-thermaldbg-v1-1-451bcb723e1d@linaro.org (mailing list archive)
State Changes Requested, archived
Headers show
Series thermal: core: Print out thermal zone name on update_temperature error | expand

Commit Message

Konrad Dybcio Dec. 18, 2023, 2:40 p.m. UTC
Currently, we can encounter an error like this:

  thermal thermal_zone48: failed to read out thermal zone (-19)

It's good to know that there's been an issue, but on some occasions
(like the error happening in the middle of a platform crash), one may
not be able to look up what kind of thermal zone that is.

Add the TZ name to the error message in order to speed up debugging.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/thermal/thermal_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


---
base-commit: ceb2fe0d438644e1de06b9a6468a1fb8e2199c70
change-id: 20231218-topic-thermaldbg-a59300435456

Best regards,

Comments

Rafael J. Wysocki Dec. 18, 2023, 7:40 p.m. UTC | #1
On Mon, Dec 18, 2023 at 3:40 PM Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>
> Currently, we can encounter an error like this:
>
>   thermal thermal_zone48: failed to read out thermal zone (-19)
>
> It's good to know that there's been an issue, but on some occasions
> (like the error happening in the middle of a platform crash), one may
> not be able to look up what kind of thermal zone that is.
>
> Add the TZ name to the error message in order to speed up debugging.

s/name/type/ ?  It looks like that's what you mean.

First, the tz type is not its name (because there may be multiple
zones of the same type) and it would be consistent with the first
paragraph above.

>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  drivers/thermal/thermal_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 2415dc50c31d..a6ccf93eb34e 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -403,8 +403,8 @@ static void update_temperature(struct thermal_zone_device *tz)
>         if (ret) {
>                 if (ret != -EAGAIN)
>                         dev_warn(&tz->device,
> -                                "failed to read out thermal zone (%d)\n",
> -                                ret);
> +                                "failed to read out thermal zone %s (%d)\n",
> +                                tz->type, ret);
>                 return;
>         }
>
>
> ---
Konrad Dybcio Dec. 19, 2023, 11:48 a.m. UTC | #2
On 18.12.2023 20:40, Rafael J. Wysocki wrote:
> On Mon, Dec 18, 2023 at 3:40 PM Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>>
>> Currently, we can encounter an error like this:
>>
>>   thermal thermal_zone48: failed to read out thermal zone (-19)
>>
>> It's good to know that there's been an issue, but on some occasions
>> (like the error happening in the middle of a platform crash), one may
>> not be able to look up what kind of thermal zone that is.
>>
>> Add the TZ name to the error message in order to speed up debugging.
> 
> s/name/type/ ?  It looks like that's what you mean.
> 
> First, the tz type is not its name (because there may be multiple
> zones of the same type) and it would be consistent with the first
> paragraph above.
That's possible, I'm no expert wrt thermal :)

Would you be okay with this change, together with an amended commit
message?

Konrad
Daniel Lezcano Dec. 19, 2023, 12:05 p.m. UTC | #3
Hi Konrad,

[Cc: Angelo]

On 19/12/2023 12:48, Konrad Dybcio wrote:
> On 18.12.2023 20:40, Rafael J. Wysocki wrote:
>> On Mon, Dec 18, 2023 at 3:40 PM Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>>>
>>> Currently, we can encounter an error like this:
>>>
>>>    thermal thermal_zone48: failed to read out thermal zone (-19)
>>>
>>> It's good to know that there's been an issue, but on some occasions
>>> (like the error happening in the middle of a platform crash), one may
>>> not be able to look up what kind of thermal zone that is.
>>>
>>> Add the TZ name to the error message in order to speed up debugging.
>>
>> s/name/type/ ?  It looks like that's what you mean.
>>
>> First, the tz type is not its name (because there may be multiple
>> zones of the same type) and it would be consistent with the first
>> paragraph above.
> That's possible, I'm no expert wrt thermal :)
> 
> Would you be okay with this change, together with an amended commit
> message?

Angelo is looking for how to sort out the name vs type confusion [1].

May be you should wait he comes with a proposal before updating the message?

[1] 
https://lore.kernel.org/all/3428b2af-5522-4090-995a-10eaee90c28e@linaro.org/
diff mbox series

Patch

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 2415dc50c31d..a6ccf93eb34e 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -403,8 +403,8 @@  static void update_temperature(struct thermal_zone_device *tz)
 	if (ret) {
 		if (ret != -EAGAIN)
 			dev_warn(&tz->device,
-				 "failed to read out thermal zone (%d)\n",
-				 ret);
+				 "failed to read out thermal zone %s (%d)\n",
+				 tz->type, ret);
 		return;
 	}