From patchwork Fri Jun 25 11:03:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 466978 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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, 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 AE157C48BC2 for ; Fri, 25 Jun 2021 11:03:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D04C6145C for ; Fri, 25 Jun 2021 11:03:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229470AbhFYLFz (ORCPT ); Fri, 25 Jun 2021 07:05:55 -0400 Received: from mout.gmx.net ([212.227.17.20]:38403 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbhFYLFw (ORCPT ); Fri, 25 Jun 2021 07:05:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624618996; bh=g/1l77n9SRFOvqNNHUd97uMSJe2gTcM2ug+hsnbl3Gk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=EMeCoMdPzNQZym6nwtrXDEQeWas1h+MMoYjDX6eep49P5tjRFBjTLvnxdU7gU66M+ JXjIXJZuisw0H+Q+0R8bDU9AdSJblpjIMNJ+d5OAFWoHTn5XXx2YCaD1cCRGY3BGxX jlGsTxNWLvqMfFxg83E2Q06TyoQVj/hWBYjeyvxU= 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 13:03:16 +0200 MIME-Version: 1.0 Message-ID: From: Frank Wunderlich To: Daniel Lezcano Cc: Eric Woudstra , 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: Re: [PATCH] Fix mt7622.dtsi thermal cpu Date: Fri, 25 Jun 2021 13:03:16 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <8b27246b-721e-fa0e-5c2b-b1b4b4d6fdd3@linaro.org> 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> <8b27246b-721e-fa0e-5c2b-b1b4b4d6fdd3@linaro.org> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:0os7uhuK8TvkyvnXgZYkBKOUKqVXeknBjyVhU8kcofVYZisfTdOZDW21UW96lmFSKWJe3 BB/hvXUJMiJizJhW1zn2Dl+fzi2CM+bBKg4Pt8OAXChs9W65IU3PA2FK4akf+z4jgP4quoY1Qkae gM35Jxb+STndPOC3BdW9tz3fMxfOHG0d2RlOHInF0eyZ8nLyOKkLGVqZiak/C06iKYR0L+Ubu6/t EXxyVbdVfi+jAvDGgGKvz+7HYpYdyfgPfX5+AXX16wIYD9IXADjmz7/8XuyjkZBhHTvGxmGLmuMl 9U= X-UI-Out-Filterresults: notjunk:1; V03:K0:9rdLbwbOXq0=:bT2NbFMJ3ks1ap4pjutQ9b gaQrK+8Jm7K3t1+Ep/+5qd16A8xx6FisDmJHZH+Pf1Bw/EKufuvej8ZOS1Y0P/DUlnPgs9f1I VoYyA46sUU/s5fP6UWBJeizpcKIXXtBts6G04Ngr0q3Sg8xsa5FX/gjS5o2FqsfwqEwxPhOi5 vDgXN8OHQ2q8vWf0tSoki7tqRwEO4Hp+fzN9nEJz3EbuN+3pWVKyJ+0CUfkYpWaV9WhLr2Fq3 +4APmI8rgavyJKWbnqf6QPc26KSwgT85uEqfyhN/bRH4TOs0mnN0TPsRnUnZ6SPGdP48tMbz8 ki0Iy7nL90+rEZo7s210HCcPrDikZ+ATelOYJWE9e+HwBSYPt4XvFJ+PTwu64z7Nb3duGJxze ZA/j9W9kOP1WSVk83667UZd/vR1UzoNqnjQdkyxdEduidpvVj8EO3F7EANrF3hirSOsZHURHi 15tn1Q/a8x3/rqghUlqcZShwlzXL3v86Hj7qhEkPHRcZvHatcFf/mgVXRMdDwha2+GxtYxW3C mgYrljdFDyzvuFt2ZE8Fpgo+bN5ngvkKHXbW+1kRsE+3yqBEGAe9O6x0oEZpOIPOq4JlrEHYX 7JX3fVNIdqx39dKQkkulqWid4O/hzjmsangdCKzot23TGh8h8u8sscMLR1cTjgy8aWWjakUqh wZzY799FuWrZHejdwRzgze84Z6GFlr4198vlT8VXBP/3/Cd220qF8rR5VU/hIkp02c1eMqKUh hc4i4RdYqBV6ERFFgRnyBDZy4CBvYFki2Yi4A+9nTnXS/A29mQFgh26pZDV0WsUhm7Kh2HqSt hPm92VPi5tnDAmYZydAe3ud6wRYgiwRt4+RaLLbZxCBARe+was= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi > Gesendet: Freitag, 25. Juni 2021 um 11:57 Uhr > Von: "Daniel Lezcano" > You should not add the fan in the mt7622.dtsi itself but in the board > specific file where there is a fan output on it. mt7622.dtsi is supposed > to be the SoC itself AFAICT. > > For instance: > > https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi#n39 > > https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi#n164 > > @@ -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>; > > }; > > fan == active trip point > > This is referring to the passive trip point. So it should point to the > CPU as it is now. Note the order of mitigation is inverted regarding the > proposal description. but we need to disable the passive trip as cpu-trotteling starts there...the higher temperature trips are currently not reached summary moving fan and cpu_thermal-override to bananapi-r64.dts passive-trip: cooling-device = <&cpu0/1 0 0> as in erics Patch active trip: cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; the other 2 unchanged but i suggest changing the temperature points in mt7622 dtsi as this is SoC specific so basicly: --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi @@ -143,13 +143,13 @@ cpu_thermal: cpu-thermal { 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,8 +170,8 @@ cpu-crit { cooling-maps { map0 { trip = <&cpu_passive>; - cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, - <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + cooling-device = <&cpu0 0 0>, + <&cpu1 0 0>; }; map1 { @@ -428,6 +428,7 @@ uart3: serial@11005000 { 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>, --- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts @@ -37,6 +37,13 @@ cpu@1 { }; }; + fan0: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + pwms = <&pwm 2 10000 0>; + cooling-levels = <0 102 170 230>; + }; + gpio-keys { compatible = "gpio-keys"; @@ -582,6 +589,29 @@ &u3phy { status = "okay"; }; +&cpu_thermal { + cooling-maps { + map1 { + trip = <&cpu_active>; + cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins>;