Re: [PATCH v1 2/3] thermal/debugfs: Pass cooling device state to thermal_debug_cdev_add()

From: Lukasz Luba
Date: Thu Apr 25 2024 - 06:02:56 EST


Hi Rafael,

On 4/23/24 19:00, Rafael J. Wysocki wrote:
From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>

If cdev_dt_seq_show() runs before the first state transition of a cooling
device, it will not print any state residency information for it, even
though it might be reasonably expected to print residency information for
the initial state of the cooling device.

For this reason, rearrange the code to get the initial state of a cooling
device at the registration time and pass it to thermal_debug_cdev_add(),
so that the latter can create a duration record for that state which will
allow cdev_dt_seq_show() to print its residency information.

Fixes: 755113d76786 ("thermal/debugfs: Add thermal cooling device debugfs information")
Reported-by: Lukasz Luba <lukasz.luba@xxxxxxx>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
---
drivers/thermal/thermal_core.c | 9 +++++++--
drivers/thermal/thermal_debugfs.c | 12 ++++++++++--
drivers/thermal/thermal_debugfs.h | 4 ++--
3 files changed, 19 insertions(+), 6 deletions(-)


I'm trying to test it on my board and do the review, but faced issue.
For some reason I couldn't apply that patch on the latest bleeding-edge
branch.
Could you help me in this please? Is there something missing in the
patch set (like one more fist patch)?

Regards,
Lukasz