linux-stable/drivers/thermal
Daniel Lezcano 7ef01f228c thermal/debugfs: Add thermal debugfs information for mitigation episodes
The mitigation episodes are recorded. A mitigation episode happens
when the first trip point is crossed the way up and then the way
down. During this episode other trip points can be crossed also and
are accounted for this mitigation episode. The interesting information
is the average temperature at the trip point, the undershot and the
overshot. The standard deviation of the mitigated temperature will be
added later.

The thermal debugfs directory structure tries to stay consistent with
the sysfs one but in a very simplified way:

thermal/
 `-- thermal_zones
     |-- 0
     |   `-- mitigations
     `-- 1
         `-- mitigations

The content of the mitigations file has the following format:

,-Mitigation at 349988258us, duration=130136ms
| trip |     type | temp(°mC) | hyst(°mC) |  duration  |  avg(°mC) |  min(°mC) |  max(°mC) |
|    0 |  passive |     65000 |      2000 |     130136 |     68227 |     62500 |     75625 |
|    1 |  passive |     75000 |      2000 |     104209 |     74857 |     71666 |     77500 |
,-Mitigation at 272451637us, duration=75000ms
| trip |     type | temp(°mC) | hyst(°mC) |  duration  |  avg(°mC) |  min(°mC) |  max(°mC) |
|    0 |  passive |     65000 |      2000 |      75000 |     68561 |     62500 |     75000 |
|    1 |  passive |     75000 |      2000 |      60714 |     74820 |     70555 |     77500 |
,-Mitigation at 238184119us, duration=27316ms
| trip |     type | temp(°mC) | hyst(°mC) |  duration  |  avg(°mC) |  min(°mC) |  max(°mC) |
|    0 |  passive |     65000 |      2000 |      27316 |     73377 |     62500 |     75000 |
|    1 |  passive |     75000 |      2000 |      19468 |     75284 |     69444 |     77500 |
,-Mitigation at 39863713us, duration=136196ms
| trip |     type | temp(°mC) | hyst(°mC) |  duration  |  avg(°mC) |  min(°mC) |  max(°mC) |
|    0 |  passive |     65000 |      2000 |     136196 |     73922 |     62500 |     75000 |
|    1 |  passive |     75000 |      2000 |      91721 |     74386 |     69444 |     78125 |

More information for a better understanding of the thermal behavior
will be added after. The idea is to give detailed statistics
information about the undershots and overshots, the temperature speed,
etc... As all the information in a single file is too much, the idea
would be to create a directory named with the mitigation timestamp
where all data could be added.

Please note this code is immune against trip ordering but not against
a trip temperature change while a mitigation is happening. However,
this situation should be extremely rare, perhaps not happening and we
might question ourselves if something should be done in the core
framework for other components first.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
[ rjw: White space fixups, rebase ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-01-12 15:37:49 +01:00
..
broadcom thermal: ns: Convert to platform remove callback returning void 2023-09-29 12:34:16 +02:00
intel thermal: trip: Send trip change notifications on all trip updates 2023-12-13 12:37:01 +01:00
mediatek thermal/drivers/mediatek/lvts_thermal: Update calibration data documentation 2023-10-19 02:43:32 +02:00
qcom Thermal control updates for 6.7-rc1 2023-10-31 15:28:37 -10:00
samsung thermal/drivers/exynos: Use set_trips ops 2024-01-02 09:33:19 +01:00
st thermal: stm: Convert to platform remove callback returning void 2023-10-02 14:24:09 +02:00
tegra thermal: tegra-bpmp: Convert to platform remove callback returning void 2023-10-02 14:24:13 +02:00
ti-soc-thermal thermal: ti-bandgap: Convert to platform remove callback returning void 2023-10-02 14:24:15 +02:00
amlogic_thermal.c thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions 2024-01-02 09:33:18 +01:00
armada_thermal.c thermal: armada: Convert to platform remove callback returning void 2023-09-29 12:34:16 +02:00
cpufreq_cooling.c - Add more thermal zone device encapsulation: prevent setting 2023-04-03 20:43:32 +02:00
cpuidle_cooling.c thermal: cpuidle_cooling: fix kernel-doc warning and a spello 2023-12-21 12:05:48 +01:00
da9062-thermal.c thermal: da9062: Convert to platform remove callback returning void 2023-09-29 12:34:16 +02:00
db8500_thermal.c thermal/drivers/db8500: Remove redundant of_match_ptr() 2023-08-16 12:09:19 +02:00
devfreq_cooling.c thermal/core: Relocate the traces definition in thermal directory 2023-04-01 20:51:45 +02:00
dove_thermal.c thermal: dove: Convert to platform remove callback returning void 2023-09-29 12:34:16 +02:00
gov_bang_bang.c thermal: core: Pass trip pointer to governor throttle callback 2023-10-20 19:26:37 +02:00
gov_fair_share.c thermal: core: Pass trip pointer to governor throttle callback 2023-10-20 19:26:37 +02:00
gov_power_allocator.c thermal: gov_power_allocator: Support new update callback of weights 2023-12-29 18:01:01 +01:00
gov_step_wise.c thermal: core: Pass trip pointer to governor throttle callback 2023-10-20 19:26:37 +02:00
gov_user_space.c thermal: core: Pass trip pointer to governor throttle callback 2023-10-20 19:26:37 +02:00
hisi_thermal.c thermal: hisi: Convert to platform remove callback returning void 2023-09-29 12:34:16 +02:00
imx8mm_thermal.c thermal/drivers/imx8mm_thermal: Fix function pointer declaration by adding identifier name 2023-10-15 23:40:09 +02:00
imx_sc_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
imx_thermal.c thermal: imx: Convert to platform remove callback returning void 2023-09-29 12:34:16 +02:00
k3_bandgap.c thermal: k3_bandgap: Convert to platform remove callback returning void 2023-09-29 12:34:17 +02:00
k3_j72xx_bandgap.c thermal: k3_j72xx_bandgap: Convert to platform remove callback returning void 2023-09-29 12:34:17 +02:00
Kconfig thermal/debugfs: Add thermal cooling device debugfs information 2024-01-12 15:34:56 +01:00
khadas_mcu_fan.c
kirkwood_thermal.c thermal: kirkwood: Convert to platform remove callback returning void 2023-09-29 12:34:17 +02:00
loongson2_thermal.c drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment 2024-01-02 09:33:18 +01:00
Makefile thermal/debugfs: Add thermal cooling device debugfs information 2024-01-12 15:34:56 +01:00
max77620_thermal.c thermal/drivers/max77620: Remove duplicate error message 2023-10-15 23:40:10 +02:00
qoriq_thermal.c thermal/drivers/qoriq: Remove redundant msg in qoriq_tmu_register_tmu_zone() 2023-06-26 12:03:14 +02:00
rcar_gen3_thermal.c thermal: rcar_gen3: Convert to platform remove callback returning void 2023-09-29 12:34:17 +02:00
rcar_thermal.c thermal: rcar: Convert to platform remove callback returning void 2023-09-29 12:34:17 +02:00
rockchip_thermal.c thermal: rockchip: Convert to platform remove callback returning void 2023-10-02 14:23:30 +02:00
rzg2l_thermal.c thermal: rzg2l: Convert to platform remove callback returning void 2023-10-02 14:23:51 +02:00
spear_thermal.c thermal: spear: Convert to platform remove callback returning void 2023-10-02 14:24:06 +02:00
sprd_thermal.c thermal: sprd: Convert to platform remove callback returning void 2023-10-02 14:24:08 +02:00
sun8i_thermal.c thermal/drivers/sun8i: Add D1/T113s THS controller support 2024-01-02 09:33:18 +01:00
thermal-generic-adc.c thermal/drivers/generic-adc: Removed unneeded call to platform_set_drvdata() 2023-08-16 12:36:21 +02:00
thermal_acpi.c thermal: ACPI: Include the right header file 2023-10-20 19:26:37 +02:00
thermal_core.c thermal/debugfs: Add thermal debugfs information for mitigation episodes 2024-01-12 15:37:49 +01:00
thermal_core.h thermal/debugfs: Add thermal cooling device debugfs information 2024-01-12 15:34:56 +01:00
thermal_debugfs.c thermal/debugfs: Add thermal debugfs information for mitigation episodes 2024-01-12 15:37:49 +01:00
thermal_debugfs.h thermal/debugfs: Add thermal debugfs information for mitigation episodes 2024-01-12 15:37:49 +01:00
thermal_helpers.c thermal/debugfs: Add thermal cooling device debugfs information 2024-01-12 15:34:56 +01:00
thermal_hwmon.c thermal: Drop redundant and confusing device_is_registered() checks 2023-12-12 13:00:28 +01:00
thermal_hwmon.h thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs() 2023-03-03 20:45:02 +01:00
thermal_mmio.c thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00
thermal_netlink.c thermal: netlink: Pass thermal zone pointer to notify routines 2024-01-09 13:32:23 +01:00
thermal_netlink.h thermal: netlink: Pass thermal zone pointer to notify routines 2024-01-09 13:32:23 +01:00
thermal_of.c thermal/thermal_of: Allow rebooting after critical temp 2024-01-02 09:33:18 +01:00
thermal_sysfs.c thermal/sysfs: Update governors when the 'weight' has changed 2023-12-29 18:01:01 +01:00
thermal_trace.h thermal/core: Relocate the traces definition in thermal directory 2023-04-01 20:51:45 +02:00
thermal_trace_ipa.h thermal: gov_power_allocator: Change trace functions 2023-12-29 18:01:00 +01:00
thermal_trip.c thermal: netlink: Pass pointers to thermal_notify_tz_trip_change() 2024-01-09 13:30:55 +01:00
uniphier_thermal.c thermal: uniphier: Convert to platform remove callback returning void 2023-10-02 14:24:17 +02:00