From patchwork Mon Aug 12 02:00:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13759979 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 F1827C3DA4A for ; Mon, 12 Aug 2024 02:01:20 +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:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=RKcmkKHprKaGo3TWBWY608Q1owHtNCcC2SHOqOY293I=; b=CkBOAONvwGN6yh9auFfBLhgWMj HNKRcw0FgOhUVlOpTVOBTYzPY2jBhDSQzIgtJmEjtzCmYTmhl4g9jcbYDHheixZD17GfhDOeTvpL5 bggI69VgGGaJVPqfEcqGvTInopoQhlhyg6oZI/hCcke/7dj4DnztUl1FG379REITuG7QMGHyqm3uS byNG9go4zUAYoEdoJdHqEdjfKQ3X2fhzjZTEvnKx99YwcZuGmTFo4M9+walWf6f+EdaHmnDu/81ur Nr3h8hGa2Bl5EE0Y6jpQ+q5EXy9jMZCeNPM5DsVMwAJd6/mNrLzvkgj7vjRq49D1r8XuFPZpxE753 3wvaAQNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdKMr-0000000GfR6-07TI; Mon, 12 Aug 2024 02:01:05 +0000 Received: from mail.manjaro.org ([116.203.91.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdKMG-0000000GfNK-090b for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 02:00:29 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1723428025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=RKcmkKHprKaGo3TWBWY608Q1owHtNCcC2SHOqOY293I=; b=wpIwxb4eGG3D+c3GHnXUf2CVr2ZT5w5LkFjXVbn6V+OdSXmxFIYnbfF7h/0LsrPP4zw0lr 1ioc2dY0WgyiIUs571TB5lTB0FbbBkluaAwCU+hR3uVzQYRDcbk/xt6Wp1WuGwq5o8fDIC NXZswVRI0U1qFgTCfdGgnsiJ24zqaitL0yMrOLttPSkRLp2DlHkseCGX3WbdNy4GgEwWXW s7YcdmGWaSbZayrdsswAwDQQR8L5TLP7t+gYYlVrpuIsHQ2fNB6GE5tm+Cr7S9RgqRwk9Q D11j34PSBO++joPeH7pImp0P9Zhd6fhzgVZH+SDGwYh29uHZYirse4erlMYR4w== To: linux-sunxi@lists.linux.dev Cc: wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, linux-kernel@vger.kernel.org, uwu@icenowy.me, wenst@chromium.org, broonie@kernel.org Subject: [PATCH] arm64: dts: allwinner: Add GPU thermal trips to the SoC dtsi for A64 Date: Mon, 12 Aug 2024 04:00:20 +0200 Message-Id: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240811_190028_561075_3DECE5BB X-CRM114-Status: GOOD ( 13.35 ) 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 Add thermal trips for the two GPU thermal sensors found in the Allwinner A64. There's only one GPU OPP defined since the commit 1428f0c19f9c ("arm64: dts: allwinner: a64: Run GPU at 432 MHz"), so defining only the critical thermal trips makes sense for the A64's two GPU thermal zones. Having these critical thermal trips defined ensures that no hot spots develop inside the SoC die that exceed the maximum junction temperature. That might have been possible before, although quite unlikely, because the CPU and GPU portions of the SoC are packed closely inside the SoC, so the overheating GPU would inevitably result in the heat soaking into the CPU portion of the SoC, causing the CPU thermal sensor to return high readings and trigger the CPU critical thermal trips. However, it's better not to rely on the heat soak and have the critical GPU thermal trips properly defined instead. While there, remove a few spotted comments that are rather redundant, because it's pretty much obvious what units are used in those places. Signed-off-by: Dragan Simic --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index e868ca5ae753..bc5d3a2e6c98 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -212,7 +212,6 @@ timer { thermal-zones { cpu_thermal: cpu0-thermal { - /* milliseconds */ polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 0>; @@ -236,40 +235,51 @@ map1 { trips { cpu_alert0: cpu-alert0 { - /* milliCelsius */ temperature = <75000>; hysteresis = <2000>; type = "passive"; }; cpu_alert1: cpu-alert1 { - /* milliCelsius */ temperature = <90000>; hysteresis = <2000>; type = "hot"; }; cpu_crit: cpu-crit { - /* milliCelsius */ temperature = <110000>; hysteresis = <2000>; type = "critical"; }; }; }; gpu0_thermal: gpu0-thermal { - /* milliseconds */ polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 1>; + + trips { + gpu0_crit: gpu0-crit { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; }; gpu1_thermal: gpu1-thermal { - /* milliseconds */ polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 2>; + + trips { + gpu1_crit: gpu1-crit { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; }; };