linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Rob Herring <robh+dt@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Device Tree Mailing List <devicetree@vger.kernel.org>,
	Linux ARM Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/4] arm64: dts: imx8mm-venice-gw700x: override thermal cfg for industrial temp
Date: Mon, 7 Jun 2021 09:20:39 +0200	[thread overview]
Message-ID: <5eba4438-239c-71d1-56ec-4edd70e87ec3@kontron.de> (raw)
In-Reply-To: <CAJ+vNU0mBQJ_ZLsKOiY0k7+drYvmw+bsHfeX4+Mg=s4_fxSUYA@mail.gmail.com>

On 04.06.21 17:42, Tim Harvey wrote:
> On Wed, Jun 2, 2021 at 12:11 AM Frieder Schrempf
> <frieder.schrempf@kontron.de> wrote:
>>
>> On 01.06.21 19:49, Tim Harvey wrote:
>>> Override the default temperature alert/crit for Industrial temp IMX8M
>>> Mini.
>>>
>>> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
>>> ---
>>>  .../boot/dts/freescale/imx8mm-venice-gw700x.dtsi     | 12 ++++++++++++
>>>  1 file changed, 12 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw700x.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw700x.dtsi
>>> index c769fadbd008..512b76cd7c3b 100644
>>> --- a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw700x.dtsi
>>> +++ b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw700x.dtsi
>>> @@ -493,3 +493,15 @@
>>>               >;
>>>       };
>>>  };
>>> +
>>> +&cpu_alert0 {
>>> +     temperature = <95000>;
>>> +     hysteresis = <2000>;
>>> +     type = "passive";
>>> +};
>>> +
>>> +&cpu_crit0 {
>>> +     temperature = <105000>;
>>> +     hysteresis = <2000>;
>>> +     type = "critical";
>>> +};
>>
>> As this is not really board-specific, I think the proper way to handle this for all boards is to let the thermal driver read the temperature grading from the OTP fuses and set the trip-points accordingly, similar to what is done on i.MX6 [1].
>>
>> [1] https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree%2Fdrivers%2Fthermal%2Fimx_thermal.c%3Fh%3Dv5.13-rc4%23n508&amp;data=04%7C01%7Cfrieder.schrempf%40kontron.de%7C7635e5c10c3e4d3fba3208d9276f5426%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637584181370793415%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=1Ed1rcaki%2FIPpFmii%2FEVc%2FAzPkzTzS9m8nplyFS90s8%3D&amp;reserved=0
> 
> Frieder,
> 
> Yes, I thought about adding that kind of support to imx8mm_thermal.c
> but the difference is that imx8mm has alerts defined by dt and imx6
> does not so is it right to override dt alerts on imx8m? What if
> someone designs a board that they specifically want a lower alert than
> the cpu grade they are using based on something else on the board?
> 
> My approach to this was to eventually actually adjust the imx8m dt
> alerts in boot firmware based on some boot firmware setting or
> specific board support and leave the kernel alone.

Allowing board-specific trip points sounds like a valid request, but I still think we need a way to handle the temperature grading in the driver if no board-specific trip-points are given.

What if we just set the temperature property in the trip nodes in imx8mm.dtsi to zero? The thermal driver would detect this and setup the correct values according to the grading. If the dt already provides non-zero temperature values (through the board dts) the driver will just leave the values and disregard the grading.

I think this solution would be covering all needs.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-07  7:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 17:49 [PATCH 1/4] arm64: dts: imx8mm-venice-gw700x: override thermal cfg for industrial temp Tim Harvey
2021-06-01 17:49 ` [PATCH 2/4] arm64: dts: imx8mm-venice-gw700x: fix mp5416 pmic config Tim Harvey
2021-07-24 18:19   ` Tim Harvey
2021-07-26  1:01     ` Shawn Guo
2021-07-27 16:05       ` Tim Harvey
2021-06-01 17:49 ` [PATCH 3/4] arm64: dts: imx8mm-venice-gw7901: add support for USB hub subload Tim Harvey
2021-07-24 18:21   ` Tim Harvey
2021-06-01 17:49 ` [PATCH 4/4] arm64: dts: imx8mm-venice-gw7901: enable pull-down on gpio outputs Tim Harvey
2021-07-24 18:19   ` Tim Harvey
2021-06-02  7:10 ` [PATCH 1/4] arm64: dts: imx8mm-venice-gw700x: override thermal cfg for industrial temp Frieder Schrempf
2021-06-04 15:42   ` Tim Harvey
2021-06-07  7:20     ` Frieder Schrempf [this message]
2021-06-07  7:30       ` Jacky Bai
2021-06-07  7:53         ` Frieder Schrempf
2021-06-07  8:00           ` Jacky Bai
2021-06-07  8:34             ` Frieder Schrempf
2021-06-11 18:55               ` Tim Harvey
2021-06-29  7:48                 ` Frieder Schrempf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5eba4438-239c-71d1-56ec-4edd70e87ec3@kontron.de \
    --to=frieder.schrempf@kontron.de \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tharvey@gateworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).