thermal/debugfs: Create records for cdev states as they get used
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 25 Apr 2024 12:24:10 +0000 (14:24 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 26 Apr 2024 13:01:56 +0000 (15:01 +0200)
commitf4ae18fcb652c6cccc834ded525ac37f91d5cdb1
tree2faf706a57a9e3295cab8336f4cacaf98dd22019
parent8c882f172f930323e9c994b5b802edf7fb471597
thermal/debugfs: Create records for cdev states as they get used

Because thermal_debug_cdev_state_update() only creates a duration record
for the old state of a cooling device, if its new state is used for the
first time, there will be no record for it and cdev_dt_seq_show() will
not print the duration information for it even though it contains code
to compute the duration value in that case.

Address this by making thermal_debug_cdev_state_update() create a
duration record for the new state if there is none.

Fixes: 755113d76786 ("thermal/debugfs: Add thermal cooling device debugfs information")
Reported-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
drivers/thermal/thermal_debugfs.c