From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 694AFC7EE32 for ; Thu, 26 Jun 2025 23:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gkj2mMHh0GxLUj/eKGxZgIwvH9Co0awqJJJrJZL4T18=; b=yOYfdlxO2D2oOR6TfyPtDUv5Ml 4we0xSsWCoClVtfK4PEFhiE5WPg0/G8UsURkKbhttCLZvS1h5ZY4EEEyukFUVhhATFtdi5MfXac6g /41iO1H1TkkXRhQlbd4h0S7Zyc1jhSyvwV82mOIvIWC0Qqtg9dcJJSj/PJmPdcBJKm76lHYliuvfH So8T4tlnbvPE6M7eVHItsSKq1mbBVNErsCd5RZYe5W4kouHhJoOu1VuWYEbO8XuwOI5kDO2QBZgM9 3jhkd2AWKV4BJGVbBORPZN1pP6W96eVTL3ibJm8cQzwdiOHOs0zEGEHfHZm1PsBUgaprDPs2yfqNS dQHg/Bcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uUwFC-0000000D5DI-0W9H; Thu, 26 Jun 2025 23:43:02 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uUuM2-0000000CrKK-2JkD for linux-arm-kernel@lists.infradead.org; Thu, 26 Jun 2025 21:42:00 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id A7DF21D00119; Thu, 26 Jun 2025 17:41:54 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 26 Jun 2025 17:41:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1750974114; x=1751060514; bh=gkj2mMHh0GxLUj/eKGxZgIwvH9Co0awqJJJrJZL4T18=; b= pxECusUjGGx3J3kjU40da8OIvnNP+kKo+jTZ+jlW/7QovnmEoQvgQlrM99A64P8I UKEKKOsSXQ6/YHOYonAJwLr4oyZAGFTez7Senc1cH8hIPtZdAumfzaUPco9sTA/S wKNgnGA2GKP1RdYX6pqgxK4fCD1A8WnndpzsxkgvgBnRdBHY7L028bLxYRzMV+0V IlA/kQZ0sX7gMPrDnsh2xXd7uaHtkjOfiHtpTZo1haqChq1QB5LOHH10KqeLHLga PbXIPvLGrj2W5XhI90+yIBjXQY0vT0tXX1Xr07DvJswmDCLPNtOwuceJw05qV+RS E6vwy0LuBcSlg5kkDQj9jg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1750974114; x= 1751060514; bh=gkj2mMHh0GxLUj/eKGxZgIwvH9Co0awqJJJrJZL4T18=; b=d Eu44YR/gGl1crkcj/CjBg8RWJBHU14zGSZeTsZXe7t17AFG/IrSgbLo7YdDkSAbo ZICx4qve7xO3yvY3FQJWGTwfwz3eMmILr0XZ+X7UqAqEZA3vjn2tBeB4I+Fofu/P Cvdt8hkG+4dvCD9WTAYvymbMmRAKwha1AHmFV5DPK+PqiG155ifT8HDYnj/mjQzt QakdsiuFL/+U8Wy5C/gee15gjnojQxEYSGS2BftsqW3AWPT+wXlV95+tx+AlDTFN TlLplfBbeMn5izaf3x46USvIaIK8uh6VOelrC0WPo7Umphzc4eRTY14b0tqUc7wZ rT8TYx6zGG6Cpp+peUCRw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epfffhvfevuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpefpihhklhgrshcu ufpnuggvrhhluhhnugcuoehnihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrghtvg gthhdrshgvqeenucggtffrrghtthgvrhhnpeevteegtddvvdfhtdekgefhfeefheetheek keegfeejudeiudeuleegtdehkeekteenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehnihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrght vggthhdrshgvpdhnsggprhgtphhtthhopeelpdhmohguvgepshhmthhpohhuthdprhgtph htthhopehmrghrvghkrdhvrghsuhhtodhrvghnvghsrghssehmrghilhgsohigrdhorhhg pdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrh gruggvrggurdhorhhgpdhrtghpthhtoheptghonhhorhdoughtsehkvghrnhgvlhdrohhr ghdprhgtphhtthhopehgvggvrhhtodhrvghnvghsrghssehglhhiuggvrhdrsggvpdhrtg hpthhtohepkhhriihkodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhgrghhn uhhsrdgurghmmhesghhmrghilhdrtghomhdprhgtphhtthhopehrohgshheskhgvrhhnvg hlrdhorhhgpdhrtghpthhtohepuggvvhhitggvthhrvggvsehvghgvrhdrkhgvrhhnvghl rdhorhhgpdhrtghpthhtoheplhhinhhugidqrhgvnhgvshgrshdqshhotgesvhhgvghrrd hkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Jun 2025 17:41:53 -0400 (EDT) Date: Thu, 26 Jun 2025 23:41:52 +0200 From: Niklas =?utf-8?Q?S=C3=B6derlund?= To: Marek Vasut Cc: linux-arm-kernel@lists.infradead.org, Conor Dooley , Geert Uytterhoeven , Krzysztof Kozlowski , Magnus Damm , Rob Herring , devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH] arm64: dts: renesas: r8a779g3: Update thermal trip points on V4H Sparrow Hawk Message-ID: <20250626214152.GA1817595@ragnatech.se> References: <20250625100330.7629-1-marek.vasut+renesas@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250625100330.7629-1-marek.vasut+renesas@mailbox.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250626_144159_069696_290B0BF4 X-CRM114-Status: GOOD ( 25.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Marek, Thanks for your work. On 2025-06-25 12:01:56 +0200, Marek Vasut wrote: > Since the Sparrow Hawk has a smaller PCB than the White Hawk, it tends > to generate more heat. To prevent potential damage to the board, adjust > the temperature trip points. > > Add four "passive" trip points which increasingly throttle the CPU to > prevent overheating. The first trip point at 68°C disables the 1.8 GHz > and 1.7 GHz modes and limits the CPU to 1.5 GHz frequency. The second > trip point at 72°C disables the 1.5 GHz mode and limits the CPU to 1.0 > GHz frequency. The third trip point at 76°C uses thermal-idle to start > inserting idle cycles into the CPU instruction stream to cool the CPU > cores down. The fourth and last trip point at 80°C disables the 1.0 GHz > mode and limits the CPU to 500 MHz frequency. > > In case the SoC heats up further, in case either of the thermal sensors > readings passes the 100°C, a thermal shutdown is triggered to prevent > any damage to the hardware. > > Signed-off-by: Marek Vasut > --- > Cc: Conor Dooley > Cc: Geert Uytterhoeven > Cc: Krzysztof Kozlowski > Cc: Magnus Damm > Cc: "Niklas Söderlund" > Cc: Rob Herring > Cc: devicetree@vger.kernel.org > Cc: linux-renesas-soc@vger.kernel.org > --- > .../dts/renesas/r8a779g3-sparrow-hawk.dts | 137 ++++++++++++++++++ > 1 file changed, 137 insertions(+) > > diff --git a/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts b/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts > index 9ba23129e65e..ba81df3c779d 100644 > --- a/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts > +++ b/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts > @@ -38,6 +38,7 @@ > > /dts-v1/; > #include > +#include > > #include "r8a779g3.dtsi" > > @@ -797,3 +798,139 @@ &rwdt { > &scif_clk { /* X12 */ > clock-frequency = <24000000>; > }; > + > +/* thermal-idle cooling for all SoC cores */ > +&a76_0 { > + #cooling-cells = <2>; > + > + a76_0_thermal_idle: thermal-idle { > + #cooling-cells = <2>; > + duration-us = <10000>; > + exit-latency-us = <500>; > + }; > +}; > + > +&a76_1 { > + a76_1_thermal_idle: thermal-idle { > + #cooling-cells = <2>; > + duration-us = <10000>; > + exit-latency-us = <500>; > + }; > +}; > + > +&a76_2 { > + a76_2_thermal_idle: thermal-idle { > + #cooling-cells = <2>; > + duration-us = <10000>; > + exit-latency-us = <500>; > + }; > +}; > + > +&a76_3 { > + a76_3_thermal_idle: thermal-idle { > + #cooling-cells = <2>; > + duration-us = <10000>; > + exit-latency-us = <500>; > + }; > +}; I did not know you could do this and use it as a cooling device, thanks for teaching me something new! > + > +/* THS sensors in SoC, critical temperature trip point is 100C */ > +&sensor1_crit { > + temperature = <100000>; > +}; > + > +&sensor2_crit { > + temperature = <100000>; > +}; > + > +&sensor3_crit { > + temperature = <100000>; > +}; > + > +&sensor4_crit { > + temperature = <100000>; > +}; > + > +&sensor_thermal_cr52 { > + critical-action = "shutdown"; > +}; > + > +&sensor_thermal_cnn { > + critical-action = "shutdown"; > +}; Is this not the default action for critical trip points? In my testing in the past R-Car systems have always shutdown when the critical trip is reached. If it's not I think we should move these to r8a779g0.dtsi. And likely add them for all other SoCs too? > + > +/* THS sensor in SoC near CA76 cores does more progressive cooling. */ > +&sensor_thermal_ca76 { > + critical-action = "shutdown"; > + > + cooling-maps { > + /* > + * The cooling-device minimum and maximum parameters inversely > + * match opp-table-0 {} node entries in r8a779g0.dtsi, in other > + * words, 0 refers to 1.8 GHz OPP and 4 refers to 500 MHz OPP. > + * This is because they refer to cooling levels, where maximum > + * cooling level happens at 500 MHz OPP, when the CPU core is > + * running slowly and therefore generates least heat. > + */ > + map0 { > + /* At 68C, inhibit 1.7 GHz and 1.8 GHz modes */ > + trip = <&sensor3_passive_low>; > + cooling-device = <&a76_0 2 4>; > + contribution = <128>; > + }; > + > + map1 { > + /* At 72C, inhibit 1.5 GHz mode */ > + trip = <&sensor3_passive_mid>; > + cooling-device = <&a76_0 3 4>; > + contribution = <256>; > + }; > + > + map2 { > + /* At 76C, start injecting idle states */ > + trip = <&sensor3_passive_hi>; > + cooling-device = <&a76_0_thermal_idle 0 80>, > + <&a76_1_thermal_idle 0 80>, > + <&a76_2_thermal_idle 0 80>, > + <&a76_3_thermal_idle 0 80>; > + contribution = <512>; > + }; > + > + map3 { > + /* At 80C, inhibit 1.0 GHz mode */ > + trip = <&sensor3_passive_crit>; > + cooling-device = <&a76_0 4 4>; > + contribution = <1024>; > + }; > + }; > + > + trips { > + sensor3_passive_low: sensor3-passive-low { > + temperature = <68000>; > + hysteresis = <2000>; > + type = "passive"; > + }; > + > + sensor3_passive_mid: sensor3-passive-mid { > + temperature = <72000>; > + hysteresis = <2000>; > + type = "passive"; > + }; > + > + sensor3_passive_hi: sensor3-passive-hi { > + temperature = <76000>; > + hysteresis = <2000>; > + type = "passive"; > + }; > + > + sensor3_passive_crit: sensor3-passive-crit { > + temperature = <80000>; > + hysteresis = <2000>; > + type = "passive"; > + }; > + }; > +}; > + > +&sensor_thermal_ddr1 { > + critical-action = "shutdown"; > +}; > -- > 2.47.2 > -- Kind Regards, Niklas Söderlund