<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: imx8mq kernel ignoring devicetree settings for thermal trips in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2071259#M235669</link>
    <description>&lt;P&gt;Hi Zhiming,&lt;/P&gt;&lt;P&gt;Yea, I started there first actually. It looks like that function only gets called when I set the trip point from userspace.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;# echo 75000 &amp;gt;/sys/class/thermal/thermal_zone0/trip_point_0_temp&lt;BR /&gt;[ 80.216814] qoriq set trip: 0 75000&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;From there, I added lines to qoriq_tmu_register_tmu_zone().&lt;/P&gt;&lt;P&gt;I then went into the dt parsing in thermal_of.c. The part I'm most confused by is that when the dt properties are read in thermal_of_populate_trip(), it logs as 95000/105000 even though the imx8mq.dtsi entries are set for 80000/90000.&lt;/P&gt;&lt;P&gt;Another odd thing is that changes to hysteresis and other properties are seen by the kernel. The temperature property is the only one that doesn't follow the dt.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Mar 2025 14:55:52 GMT</pubDate>
    <dc:creator>jmp</dc:creator>
    <dc:date>2025-03-31T14:55:52Z</dc:date>
    <item>
      <title>imx8mq kernel ignoring devicetree settings for thermal trips</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2068066#M235482</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Our hardware team asked that I reduce the trip points for the thermal monitoring on our imx8mq board based on the EVK design. I've updated the trip points with the following in an attempt to set the requested temperatures:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;amp;cpu_thermal {
	trips {
		cpu_alert: cpu-alert {
			temperature = &amp;lt;75000&amp;gt;;
			hysteresis = &amp;lt;2000&amp;gt;;
			type = "passive";
		};

		cpu-crit {
			temperature = &amp;lt;85000&amp;gt;;
			hysteresis = &amp;lt;2000&amp;gt;;
			type = "critical";
		};
	};
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the board still shows 9500 for alert, and 105000 for critical in /sys/class/thermal/thermal_zone0/trip_point_*.&lt;/P&gt;&lt;P&gt;What's odd is that the devicetree node under /sys/firmware (or /proc/device-tree) also has 95000/105000. (Seen in /sys/firmware/devicetree/base/thermal-zones/cpu-thermal/trips/cpu-*/temperature)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;# xxd /sys/firmware/devicetree/base/thermal-zones/cpu-thermal/trips/cpu-alert/temperature&lt;BR /&gt;00000000: 000&lt;STRONG&gt;1 7318&lt;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But when I decompile the devicetree, it has the values I set in the devicetree source.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;dtc -I dtb -O dts imx8mq-custom.dtb -o test.dts&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;LI-CODE lang="c"&gt;				cpu-alert {
					temperature = &amp;lt;0xfde8&amp;gt;;
					hysteresis = &amp;lt;0x7d0&amp;gt;;
					type = "passive";
					phandle = &amp;lt;0x0a&amp;gt;;
				};

				cpu-crit {
					temperature = &amp;lt;0x14c08&amp;gt;;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some reason, the kernel is ignoring my devicetree. This is further evident by the fact that it doesn't even report the values from imx8mq.dtsi - 80000/90000.&lt;/P&gt;&lt;P&gt;I've tried adding logging to &lt;STRONG&gt;qoriq_thermal.c&lt;/STRONG&gt; and &lt;STRONG&gt;thermal_of.c&lt;/STRONG&gt; to try to figure out where this is coming from, but all logs report 95000/105000.&lt;/P&gt;&lt;P&gt;I'm using the 6.6 kernel from the scarthgap BSP. I also changed the u-boot device tree and verified that u-boot does see those changes.&lt;/P&gt;&lt;P&gt;What is the correct process for modifying the thermal trip points?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is similar to the issue below, but there wasn't a solution to draw from:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/imx8mp-reading-temperature-in-devicetree-trips-heat-handling-is/td-p/1875203" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/imx8mp-reading-temperature-in-devicetree-trips-heat-handling-is/td-p/1875203&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 20:18:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2068066#M235482</guid>
      <dc:creator>jmp</dc:creator>
      <dc:date>2025-03-25T20:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: imx8mq kernel ignoring devicetree settings for thermal trips</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2070678#M235639</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Did you try to add logs in&amp;nbsp;&lt;SPAN&gt;tmu_set_trip_temp?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Please try to add dump_stack() in&amp;nbsp;&lt;SPAN&gt;tmu_set_trip_temp&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 00:15:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2070678#M235639</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2025-03-31T00:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: imx8mq kernel ignoring devicetree settings for thermal trips</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2071259#M235669</link>
      <description>&lt;P&gt;Hi Zhiming,&lt;/P&gt;&lt;P&gt;Yea, I started there first actually. It looks like that function only gets called when I set the trip point from userspace.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;# echo 75000 &amp;gt;/sys/class/thermal/thermal_zone0/trip_point_0_temp&lt;BR /&gt;[ 80.216814] qoriq set trip: 0 75000&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;From there, I added lines to qoriq_tmu_register_tmu_zone().&lt;/P&gt;&lt;P&gt;I then went into the dt parsing in thermal_of.c. The part I'm most confused by is that when the dt properties are read in thermal_of_populate_trip(), it logs as 95000/105000 even though the imx8mq.dtsi entries are set for 80000/90000.&lt;/P&gt;&lt;P&gt;Another odd thing is that changes to hysteresis and other properties are seen by the kernel. The temperature property is the only one that doesn't follow the dt.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 14:55:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2071259#M235669</guid>
      <dc:creator>jmp</dc:creator>
      <dc:date>2025-03-31T14:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: imx8mq kernel ignoring devicetree settings for thermal trips</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2071823#M235704</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I find that the possible answer is in uboot:&amp;nbsp;arch/arm/mach-imx/imx8m/soc.c&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;static int fixup_thermal_trips(void *blob, const char *name)
{
	int minc, maxc;
	int node, trip;

	node = fdt_path_offset(blob, "/thermal-zones");
	if (node &amp;lt; 0)
		return node;

	node = fdt_subnode_offset(blob, node, name);
	if (node &amp;lt; 0)
		return node;

	node = fdt_subnode_offset(blob, node, "trips");
	if (node &amp;lt; 0)
		return node;

	get_cpu_temp_grade(&amp;amp;minc, &amp;amp;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;
		}
	}

	return 0;
}&lt;/LI-CODE&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;ft_system_setup&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;function is trying to get speed grade , deleting the unused IP like gpu, NPU, hdmi, vpu referring the chip id , and then modify the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;thermals in dtb. You can try to verify it.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 08:04:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2071823#M235704</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2025-04-01T08:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: imx8mq kernel ignoring devicetree settings for thermal trips</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2072236#M235744</link>
      <description>&lt;P&gt;Hi Zhiming,&lt;/P&gt;&lt;P&gt;That was it. Thank you very much.&lt;/P&gt;&lt;P&gt;A quick test letting the preexisting dt values remain gives me the correct trips in /sys:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;		temp = fdt_getprop_u32_default_node(blob, trip, 0, "temperature", 0);
		if (!strcmp(type, "critical") &amp;amp;&amp;amp; (!temp || temp &amp;gt; (maxc * 1000)))
			temp = 1000 * maxc;
		else if (!strcmp(type, "passive") &amp;amp;&amp;amp; (!temp || temp &amp;gt; ((maxc - 10) * 1000)))
			temp = 1000 * (maxc - 10);&lt;/LI-CODE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;# cat /sys/class/thermal/thermal_zone0/trip_point_*temp&lt;BR /&gt;75000&lt;BR /&gt;85000&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 17:26:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx8mq-kernel-ignoring-devicetree-settings-for-thermal-trips/m-p/2072236#M235744</guid>
      <dc:creator>jmp</dc:creator>
      <dc:date>2025-04-01T17:26:19Z</dc:date>
    </item>
  </channel>
</rss>

