thermal/debugfs: Create records for cdev states as they get used
BugLink: https://bugs.launchpad.net/bugs/2071621
[ Upstream commit f4ae18fcb652c6cccc834ded525ac37f91d5cdb1 ]
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: 755113d767 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Stefan Bader
parent
36462f88eb
commit
77f1796ce3
@@ -435,6 +435,14 @@ void thermal_debug_cdev_state_update(const struct thermal_cooling_device *cdev,
|
||||
}
|
||||
|
||||
cdev_dbg->current_state = new_state;
|
||||
|
||||
/*
|
||||
* Create a record for the new state if it is not there, so its
|
||||
* duration will be printed by cdev_dt_seq_show() as expected if it
|
||||
* runs before the next state transition.
|
||||
*/
|
||||
thermal_debugfs_cdev_record_get(thermal_dbg, cdev_dbg->durations, new_state);
|
||||
|
||||
transition = (old_state << 16) | new_state;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user