From patchwork Fri Jun 25 08:16:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 12344779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45732C2B9F4 for ; Fri, 25 Jun 2021 10:40:50 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 15CAB613F3 for ; Fri, 25 Jun 2021 10:40:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15CAB613F3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=public-files.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To:Date:Subject:Cc: To:From:Message-ID:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FnrHPW5bcUlFdU6mE+qMNNuhgiCpT7I9DQOQl4C8YXs=; b=G2m+BRg+Y5W//m QeicZYCo9LlXW0L+m7qCSPuSFzRqJuQTwg5Fa0/7XHc8uloRc6FGZFPHXOwtxxTdJ+W/FMh2PUpM+ eQCheLhRvWCg5YgAXC0+3yLmvxTw3Wm47T6eBWhovt19FLNn+c8ntyzFhVSYDiH8iT/SKQXqbpFJp 6BBbUUFjwP9De7I3xNOTzpJXLSN35wYqGMsxyOjP1toPmddIb/tMRYL5+JdrsEGwS4CH286wO710D W5UI9LFACsMzZvQodRL3KeOMWeq+2nez3xPM6Cg+gU/KpF8l9gbajb/5baH2mV5qlpbPamiaZ6dIC qywCjZjNsdks8NbzbT0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwjEM-0011lY-4Z; Fri, 25 Jun 2021 10:38:39 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwije-000qt4-Mn; Fri, 25 Jun 2021 10:06:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624615613; bh=KPSrVHtFgQjR0DccR13l5IWzueT0aS5xNt0lrvk59Oc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=MITrXs43sljwPyxsQerYjzB2ZZDsKAWYEMnBGflRuQxQAyABfOuAVb+hKXP8M9e6i t0E/fraHnV8YrbavUP8jpdPLB3iA2C7yxzTwk4v8RB9ztS3FpXjPCjMEesAFhuau7R vvKu11tS7OJZqcI9cpH+3pCQCNyHmqJkXBszXws0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [217.61.157.219] ([217.61.157.219]) by web-mail.gmx.net (3c-app-gmx-bs66.server.lan [172.19.170.210]) (via HTTP); Fri, 25 Jun 2021 10:16:43 +0200 MIME-Version: 1.0 Message-ID: From: Frank Wunderlich To: Eric Woudstra Cc: Daniel Lezcano , Rob Herring , Matthias Brugger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Sean Wang , Ryder Lee , Daniel Golle Subject: Aw: Re: [PATCH] Fix mt7622.dtsi thermal cpu Date: Fri, 25 Jun 2021 10:16:43 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <3dd22cf2-1186-4870-aa49-e5cddc18c6e9@gmail.com> References: <20210619121927.32699-1-ericwouds@gmail.com> <56fb5540-fb86-4e6a-a596-1276026b37e5@gmail.com> <47261865-00e3-41eb-bb36-2b939f81f1e8@gmail.com> <189b52d5-b103-43e1-a64f-1e627fbc75af@gmail.com> <173e6bab-9d21-eb28-9b91-a5f80c01fd03@linaro.org> <3dd22cf2-1186-4870-aa49-e5cddc18c6e9@gmail.com> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:4154xVDgSfyG4t08O7Ht9tPl5ySlXuRPX9mO546NB9MEsmBGYGbuNdW1daSYpnkev6AqM q8ii1ZC6PODAWiCN6EDefPVGOxPhdR0BJT5+s5s6oh948EnixcAJNO6fbZgJzfgqU9SSzOpHBIFq mKMSWO0QdldOBlNGJjdVNIJtH0hCWu0/QBIwHjtLpbKcYOcbR9eBDnGhWNdv/TsQDo8VbGwpkPbW OXEei+hhi5DnplcNorFsuqzv47Q4ykmYafc6huTcnSz8ClT4MrqhPY/zod4vn2bzjB6aRHw16Vxv FU= X-UI-Out-Filterresults: notjunk:1;V03:K0:ug4CERVGxc0=:gJVLSf7Sw0AbTBnHINFIRG oGdg4FloVG+ciU44x5h6I+B7Z1/X9CUNBdsvt8Q+3nmTs0ihRwnB/uYcuV7uBoeCWAhPcxp1T kspuCghJ87K+K/4UOD/Drs7YtHqqyaMM3gtU75axMa/3rfA9cZGaNMfB607QMPQKBLhUZWYUI ho4R9TlT/lq98sSIlt7FTKeaiPQl2mgGyh+49HazurYwpCOmRkQ8Be7s8ViVZ3+r1n854AMZm v6E9hxcvb34seukGOxPUGd+sAEXvx0ON3DIfuecelQVIziw8kB6dqV+wlGCiY3xUx2Z3yFJRq 57G9x6KVfAhZ7uC58Uguv7ia7UAZfIqar1dpZS4UkI6myUGQisZmyPJQRR2B3H+3io6swyLlT RS5pltDhk05PJgv51qvdM+WKk8MRhD/kGQ1jifcYESEkgGKaPcp6K4Wlv1oaie+g+KTuhOveq JI1PlgSPl7K9PSHtrKO0wX4cpfecrPonlibSi6T36igOCLGHVcTfmFhicJVIy/hmCCDiu+3j8 9hou7AUwSR6WeHlyadf10b41MiMrtJ7PX6cuzuRIV3S0Ncr9U2uTkIvTeggMI1qSxhuOLPudb cO21C84FArOObkSupGf9Obg1tkPbqCS8RC76HCI2asWgbtvOpA0F3fmgohjZgF5BjFRPb/gvB PROpn7585ofI2CQ4HTv+a7iXlWmoXFNV6iaY0UyBhedl6U31EMqb/hI2L7eM6iayWPt/47TbA kChbIeWhG8DRC/Po07urKsCaWNeqtpD5OPpWdmNbfMkJI8iaQEZHjsqgH7PMptOUJEqtIGJNt nqeTq++1sZA9YrjUHSaWkL2QsL9UjKuOlGegfwOermeh1c2m48= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210625_030655_120405_2B6D6736 X-CRM114-Status: GOOD ( 14.01 ) 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, > Gesendet: Donnerstag, 24. Juni 2021 um 15:29 Uhr > Von: "Eric Woudstra" > The SOC runs unthrotlled slowly to 80 degrees. This takes minutes. Polling interval 1 second or less does not matter much when looking at these temperature rise times > > After that in more then an hour it slowly creeps up to 85. I believe the design is so that the SOC, under normal circumstances, can run at 1.35 GHz without throttling frequency, without heatsink. It just needs a safeguard for different circumstances. > > Most of these SOCs can also run in industrial grade circumstances, which means up to 85 degrees ambient temperature already . If not industrial then this would be 60 degrees ambient already > > But only someone at Mediatek can confirm this maybe Matthias knows anybody? get_maintainers-script shows no mtk employee for mtk_thermal driver, added Sean and Ryder as common Linux-Contacts... Daniel from openwrt have some other mt7622 Boards maybe he can test the Fan approach below > On Jun 24, 2021, 12:21 PM, at 12:21 PM, Daniel Lezcano wrote: > >Found that: > > > >https://download.kamami.pl/p579344-MT7622A_Datasheet_for_BananaPi_Only%281%29.pdf > > > >Chapter 3.3 - Thermal Characteristics > > > >Given the values I suggest: > > > > - Passive - 80°C > > > > - Hot - 90°C > > > > - Critical - 100°C maybe adding FAN (r64, don't know for other mt7622 boards) for lower 2 trips (with adjusted temperature points) and cpu-throtteling for upper 2 trips something like this (used the 70/80 trip points discussed before): regards Frank --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi @@ -134,6 +134,13 @@ }; }; + fan0: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + pwms = <&pwm 2 10000 0>; + cooling-levels = <0 102 170 230>; + }; + thermal-zones { cpu_thermal: cpu-thermal { polling-delay-passive = <1000>; @@ -143,13 +150,13 @@ trips { cpu_passive: cpu-passive { - temperature = <47000>; + temperature = <70000>; hysteresis = <2000>; type = "passive"; }; cpu_active: cpu-active { - temperature = <67000>; + temperature = <80000>; hysteresis = <2000>; type = "active"; }; @@ -170,14 +177,12 @@ cooling-maps { map0 { trip = <&cpu_passive>; - cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, - <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; }; map1 { trip = <&cpu_active>; - cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, - <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; }; map2 { @@ -428,6 +433,7 @@ pwm: pwm@11006000 { compatible = "mediatek,mt7622-pwm"; reg = <0 0x11006000 0 0x1000>; + #pwm-cells = <3>; interrupts = ; clocks = <&topckgen CLK_TOP_PWM_SEL>, <&pericfg CLK_PERI_PWM_PD>,