Difference Between DTS Thermal Configuration and Runtime Thermal Trip Points IMX93

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Difference Between DTS Thermal Configuration and Runtime Thermal Trip Points IMX93

190 Views
Jamal
Contributor II

Hi,

We observed the following thermal configuration in the file:

arch/arm64/boot/dts/freescale/imx93.dtsi

thermal-zones {
cpu-thermal {
polling-delay-passive = <250>;
polling-delay = <2000>;

thermal-sensors = <&tmu 0>;

trips {
cpu_alert: cpu-alert {
temperature = <80000>;
hysteresis = <2000>;
type = "passive";
};

cpu_crit: cpu-crit {
temperature = <90000>;
hysteresis = <2000>;
type = "critical";
};
};
};
};

However, on the running system, the sysfs entries report different values:

cat /sys/class/thermal/thermal_zone0/trip_point_0_temp
95000

cat /sys/class/thermal/thermal_zone0/trip_point_1_temp
105000

This indicates that the passive trip point is set to 95°C and the critical trip point is set to 105°C at runtime, which differs from the values defined in the DTS file (80°C and 90°C).

Could you please clarify why these values are different? Is there any other location in the kernel, driver, or platform code where these thermal trip points are being modified or overridden at runtime?

Kindly let us know where we can further investigate this behavior.

Regards,
Jamal Deen

Tags (2)
0 Kudos
Reply
1 Reply

172 Views
yipingwang
NXP TechSupport
NXP TechSupport

On imx93evk board, I checked the following dts configuration.

root@imx93evk:/tmp# hexdump -C /sys/firmware/devicetree/base/thermal-zones/cpu-thermal/trips/cpu-alert/temperature

00000000  00 01 73 18                                       |..s.|

00000004

root@imx93evk:/tmp# hexdump -C /sys/firmware/devicetree/base/thermal-zones/cpu-thermal/trips/cpu-crit/temperature

00000000  00 01 9a 28                                       |...(|

00000004

 

HEX 19a28 = 105000(DEC)

HEX 17318 = 95000(DEC)

It means the DTS has already been modified by u-boot before loading by Linux Kernel.

Please refer to function fixup_thermal_trips in arch/arm/mach-imx/fdt.c in u-boot source code.

get_cpu_temp_grade(&minc, &maxc);

fdt_for_each_subnode(trip, blob, node) {
const char *type;
int temp, ret;

type = fdt_getprop(blob, trip, "type", NULL);
if (!type)
continue;

temp = 0;
if (!strcmp(type, "critical"))
temp = 1000 * maxc;
else if (!strcmp(type, "passive"))
temp = 1000 * (maxc - 10);
if (temp) {
ret = fdt_setprop_u32(blob, trip, "temperature", temp);
if (ret)
return ret;
}

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2378083%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EDifference%20Between%20DTS%20Thermal%20Configuration%20and%20Runtime%20Thermal%20Trip%20Points%20IMX93%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2378083%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20observed%20the%20following%20thermal%20configuration%20in%20the%20file%3A%3C%2FP%3E%3CP%3Earch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx93.dtsi%3C%2FP%3E%3CP%3Ethermal-zones%20%7B%3CBR%20%2F%3Ecpu-thermal%20%7B%3CBR%20%2F%3Epolling-delay-passive%20%3D%20%26lt%3B250%26gt%3B%3B%3CBR%20%2F%3Epolling-delay%20%3D%20%26lt%3B2000%26gt%3B%3B%3C%2FP%3E%3CP%3Ethermal-sensors%20%3D%20%26lt%3B%26amp%3Btmu%200%26gt%3B%3B%3C%2FP%3E%3CP%3Etrips%20%7B%3CBR%20%2F%3Ecpu_alert%3A%20cpu-alert%20%7B%3CBR%20%2F%3Etemperature%20%3D%20%26lt%3B80000%26gt%3B%3B%3CBR%20%2F%3Ehysteresis%20%3D%20%26lt%3B2000%26gt%3B%3B%3CBR%20%2F%3Etype%20%3D%20%22passive%22%3B%3CBR%20%2F%3E%7D%3B%3C%2FP%3E%3CP%3Ecpu_crit%3A%20cpu-crit%20%7B%3CBR%20%2F%3Etemperature%20%3D%20%26lt%3B90000%26gt%3B%3B%3CBR%20%2F%3Ehysteresis%20%3D%20%26lt%3B2000%26gt%3B%3B%3CBR%20%2F%3Etype%20%3D%20%22critical%22%3B%3CBR%20%2F%3E%7D%3B%3CBR%20%2F%3E%7D%3B%3CBR%20%2F%3E%7D%3B%3CBR%20%2F%3E%7D%3B%3C%2FP%3E%3CP%3EHowever%2C%20on%20the%20running%20system%2C%20the%20sysfs%20entries%20report%20different%20values%3A%3C%2FP%3E%3CP%3Ecat%20%2Fsys%2Fclass%2Fthermal%2Fthermal_zone0%2Ftrip_point_0_temp%3CBR%20%2F%3E95000%3C%2FP%3E%3CP%3Ecat%20%2Fsys%2Fclass%2Fthermal%2Fthermal_zone0%2Ftrip_point_1_temp%3CBR%20%2F%3E105000%3C%2FP%3E%3CP%3EThis%20indicates%20that%20the%20passive%20trip%20point%20is%20set%20to%2095%C2%B0C%20and%20the%20critical%20trip%20point%20is%20set%20to%20105%C2%B0C%20at%20runtime%2C%20which%20differs%20from%20the%20values%20defined%20in%20the%20DTS%20file%20(80%C2%B0C%20and%2090%C2%B0C).%3C%2FP%3E%3CP%3ECould%20you%20please%20clarify%20why%20these%20values%20are%20different%3F%20Is%20there%20any%20other%20location%20in%20the%20kernel%2C%20driver%2C%20or%20platform%20code%20where%20these%20thermal%20trip%20points%20are%20being%20modified%20or%20overridden%20at%20runtime%3F%3C%2FP%3E%3CP%3EKindly%20let%20us%20know%20where%20we%20can%20further%20investigate%20this%20behavior.%3CBR%20%2F%3E%3CBR%20%2F%3ERegards%2C%3CBR%20%2F%3EJamal%20Deen%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2378122%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Difference%20Between%20DTS%20Thermal%20Configuration%20and%20Runtime%20Thermal%20Trip%20Points%20IMX93%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2378122%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EOn%20imx93evk%20board%2C%20I%20checked%20the%20following%20dts%20configuration.%3C%2FP%3E%0A%3CP%3Eroot%40imx93evk%3A%2Ftmp%23%20hexdump%20-C%20%2Fsys%2Ffirmware%2Fdevicetree%2Fbase%2Fthermal-zones%2Fcpu-thermal%2Ftrips%2Fcpu-alert%2Ftemperature%3C%2FP%3E%0A%3CP%3E00000000%26nbsp%3B%2000%2001%2073%2018%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7C..s.%7C%3C%2FP%3E%0A%3CP%3E00000004%3C%2FP%3E%0A%3CP%3Eroot%40imx93evk%3A%2Ftmp%23%20hexdump%20-C%20%2Fsys%2Ffirmware%2Fdevicetree%2Fbase%2Fthermal-zones%2Fcpu-thermal%2Ftrips%2Fcpu-crit%2Ftemperature%3C%2FP%3E%0A%3CP%3E00000000%26nbsp%3B%2000%2001%209a%2028%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7C...(%7C%3C%2FP%3E%0A%3CP%3E00000004%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHEX%2019a28%20%3D%20105000(DEC)%3C%2FP%3E%0A%3CP%3EHEX%2017318%20%3D%2095000(DEC)%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EIt%20means%20the%20DTS%20has%20already%20been%20modified%20by%20u-boot%20before%20loading%20by%20Linux%20Kernel.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EPlease%20refer%20to%20function%20fixup_thermal_trips%20in%20arch%2Farm%2Fmach-imx%2Ffdt.c%20in%20u-boot%20source%20code.%3C%2FP%3E%0A%3CP%3Eget_cpu_temp_grade(%26amp%3Bminc%2C%20%26amp%3Bmaxc)%3B%3C%2FP%3E%0A%3CP%3Efdt_for_each_subnode(trip%2C%20blob%2C%20node)%20%7B%3CBR%20%2F%3Econst%20char%20*type%3B%3CBR%20%2F%3Eint%20temp%2C%20ret%3B%3C%2FP%3E%0A%3CP%3Etype%20%3D%20fdt_getprop(blob%2C%20trip%2C%20%22type%22%2C%20NULL)%3B%3CBR%20%2F%3Eif%20(!type)%3CBR%20%2F%3Econtinue%3B%3C%2FP%3E%0A%3CP%3Etemp%20%3D%200%3B%3CBR%20%2F%3Eif%20(!strcmp(type%2C%20%22critical%22))%3CBR%20%2F%3Etemp%20%3D%201000%20*%20maxc%3B%3CBR%20%2F%3Eelse%20if%20(!strcmp(type%2C%20%22passive%22))%3CBR%20%2F%3Etemp%20%3D%201000%20*%20(maxc%20-%2010)%3B%3CBR%20%2F%3Eif%20(temp)%20%7B%3CBR%20%2F%3Eret%20%3D%20fdt_setprop_u32(blob%2C%20trip%2C%20%22temperature%22%2C%20temp)%3B%3CBR%20%2F%3Eif%20(ret)%3CBR%20%2F%3Ereturn%20ret%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E