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: 466995 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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham 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 40DEAC2B9F4 for ; Fri, 25 Jun 2021 08:16:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FBBE6141C for ; Fri, 25 Jun 2021 08:16:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229839AbhFYITS (ORCPT ); Fri, 25 Jun 2021 04:19:18 -0400 Received: from mout.gmx.net ([212.227.15.19]:45153 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbhFYITS (ORCPT ); Fri, 25 Jun 2021 04:19:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624609003; bh=KPSrVHtFgQjR0DccR13l5IWzueT0aS5xNt0lrvk59Oc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=YGWHfdTXSfOQ4LmR7/hDAc2DAh1Io6AaVX9/oWX9+KScNU7XqxZizggmy1oxsBEi5 i0V2DWKGr5pqMHEFw09+PS6575nydXNOacuvqfwLzjwUJSDZr/keEYBOecdcTrfYg+ dj94cM6JWV0aR84xBjqzNU0zP5s9GsxJDY8KBgbI= 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:UkCnIuOiaLQ=:1EtElga8OjLd/1aVJ8OeWg GOB7UgKTLZ3X1+WANSd7qmaG+M9DdejmOHur5CPAb/FfDE2y+MOtZOye6qDv6kbbnXLGAbzVs lOyLusA2Pr1veBOj27hwlgMSKWVusSzxghFTLDaA3m6bG26zPbUFo1FKmDYTkmd/Dk9vzVT6K dAM62vO7h2IOdjJfmZEn4cA0bBIRY8MgaAZxCAbh3exjN/DRfSahsn0jV2OCraQBUK7tLVrk5 9odlS2gY4bvAyls5QvFgXmA8hvyuJoJUtMPTe5ORA3jm7xh+bBo5S7WoXxrObwJtGnECQbtVD rxhjLWdWDTmOA6ZOlNZh0xUH44q91Nx7vC5ae3gwTfYhL/TiayOJZmPdpvUdgU1sdQE+k/qaI D9Iy/3O5B3XUUk6df7M4EgtIf0+twphoK4Ex4wVIT8f65p06qXxLcHM+066t9RffQFCATXHRW sbl6GHa+MUqbmljLzWWebn/M2g9AEfMeOVQq8pDLVcZu0AahDmnjMrLYWzx7CmKfgtyp3HGq5 60AWujl+lokqm9j7J4ovmR+MPIypcYbi3CDvtE7uugnCc/OHEy46Xc8nRMVNckBUWFNHvB1QQ PFcsFfqmREYMOksGDz7O2y2zpws5SBpnUCAhJtaS6duN620UlOg5KblzepmMqKemlsx+O8WUP j/ASMap2nID/kgU6/S7aa1Gy85V+ZN+wNFDr+j+ZGYl8UT3HSqHrgjIq+QdjgKEWDVYNRR7fe i3EyIRCqtQlw8Y9vYduNJjzu5wuk2ixqeAZtB95itD8gR+0yCEKjrCCKWo6+0iAOyhtIFI93O Yvh95Otll1gfCxYyI6v5PAHHNPl5pau2IBepPDbfinPHH1OUf4= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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>,