Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1038302pxv; Fri, 25 Jun 2021 04:09:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6TESd/CZoIl/n9YZmFPCCoDk1aX8HnxWkPpvPUE6Vb/g/8B3Zvz4w7adClz6He5dwkwsX X-Received: by 2002:a6b:c305:: with SMTP id t5mr8413302iof.202.1624619393187; Fri, 25 Jun 2021 04:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624619393; cv=none; d=google.com; s=arc-20160816; b=es5ulQBUxvSe3ag+CQaUQwMCPkXkZGgWV/huU8s3n6R1uw9/+LpP93K/+dt7ux8Y7C CWD41vM6GXPfl9yGk8I2eSRcwy8O/A0ncsFGVXhwOf60DkrW6waLraVOVP7/HEBiDJXX YYapb4DxA674g5YE3EjjRMJRUfuQjIuOojJbWjKbb1Yb2ny1xquf70xOCGVpCI4xdGmx jmY0oR+h8EyiRSerf1GgWpSo79ebMvwcSgJEclODFHvHPw+u60rZCKL3XwefALqCicNh ucN0rn+bKVDHZCacWQvWl2wh/3cNSn3dg0Tjj6v3FU5PlaCW/bCLhCUR96jn7JWnzeDm uzFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:cc:to:date:from:subject :content-transfer-encoding:mime-version:user-agent:thread-topic :references:in-reply-to:dkim-signature; bh=zS+Sy2JuyXUjHyIS0w19cZln6zoHhOgeM0Qhc+/cXBs=; b=pMrhmgHCozdbhtRevMxmLY2OlArjCS7c+X9eNXO3VxFXwHX3hJN0BwVyX/iRabrOAd 9cdr4ofzcPLNsKN6yQ7t67ZjLJqncaxa9WoZTq6f+TrQizN6SY3XUqNScXJ4PJtsSrzK mFKeTvpoPJOxRxrTahjisbOQuHtBlllu5Yt704soNiwq0xAOlaQdVcLSWUJdwDjGKuSz T+8rWrlqX4gM3MgZw35Q07lWqf2KROwCcb0+SyT2rmLsCwwglC23D41r+CxFdW6Cmv+6 Z2wTBtim9aE3+knEd+3zrksMxAaV8HhbsgT8OzA/BgPtLqp98sOGZGQbJS0bPy6MeSGy lKFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=R9EzdJqK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y196si297970iof.35.2021.06.25.04.09.40; Fri, 25 Jun 2021 04:09:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=R9EzdJqK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230326AbhFYLKH (ORCPT + 99 others); Fri, 25 Jun 2021 07:10:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbhFYLKG (ORCPT ); Fri, 25 Jun 2021 07:10:06 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A50CC061574; Fri, 25 Jun 2021 04:07:46 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id h2so12892296edt.3; Fri, 25 Jun 2021 04:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=in-reply-to:references:thread-topic:user-agent:mime-version :content-transfer-encoding:subject:from:date:to:cc:message-id; bh=zS+Sy2JuyXUjHyIS0w19cZln6zoHhOgeM0Qhc+/cXBs=; b=R9EzdJqKI8fn9iZhp0YgJ8pfmVFefMTQMKVqSscunCMLjkjqYZfF3rRvJKIsiNHY2R SzPAZOKlqWsCCjE8VOAunUzBWWUL2M/ep75WyXHfk0Ro8KUSvcPLV6Dxt6FObgsyB8eg JHL8+fxD/v9BEALcIQDv7HS/g/dgsLKOOxgfqMf1vSsWcXD/HjtTMg0PJrQWnuNHO6nq jWyi32oA/WGhWp1ww+q4UuecpGmmCBaqbDqaEGciBpqeuY/GTpgVEiPl52bBTr9w6Ttf JfRYrpXFPCRvLReavNC2tBgVdoxqFX/7GxPADzdV1No0Ln2xvCdvBGiXvuiqr8Bx97Id W8RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:in-reply-to:references:thread-topic:user-agent :mime-version:content-transfer-encoding:subject:from:date:to:cc :message-id; bh=zS+Sy2JuyXUjHyIS0w19cZln6zoHhOgeM0Qhc+/cXBs=; b=UbwJ/DzR7KsjdvMNO4/Ava6ixSKBjq6wOz4AxeBAd75/Sahe12nePTe1J90q9iVtKs Y1BW85jWtwiZbT3UB/2TITvmYy0tC/Fb59/Hu4Pt6wdiSARFvATfSueldtWudhIT+sO0 3lbPDwLxSFhL/XgVJ00ixriXKZrhyQaVcc3cW3VXpsbO3XyRwJ/BaFdM5IPGZICxR9wk GWPA8xMUl8NJXy+cXrgePuhlzuamjH0FtbNxE1Y1ANmH93tqXLs2WVmhE7emz5CEFH+2 JYNZDBzFCuK4oM2FJPbFTi8lMkRNFT80i92AjSpezLJPQoqy/nVrbauqyn0SwBIqNRHC n1gQ== X-Gm-Message-State: AOAM533SpQ9EumDdyaQUMzolZSAZTycxBYXyRnSiMHv45DCmbcBT5JiL 5Lko2bjhwKnnvEDy7cqoUPg= X-Received: by 2002:a05:6402:31b4:: with SMTP id dj20mr14094807edb.186.1624619264824; Fri, 25 Jun 2021 04:07:44 -0700 (PDT) Received: from [10.73.177.209] ([89.205.226.136]) by smtp.gmail.com with ESMTPSA id j19sm2626800ejo.3.2021.06.25.04.07.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Jun 2021 04:07:44 -0700 (PDT) In-Reply-To: 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-Referenced-Uid: 5607 Thread-Topic: Aw: Re: Re: [PATCH] Fix mt7622.dtsi thermal cpu X-Blue-Identity: !l=334&o=43&fo=5970&pl=224&po=0&qs=PREFIX&f=HTML&m=!%3ANzRiZDk5M2QtNTJhNy00MTE4LThlNmYtYTk2ZDg2NDQzNGU0%3ASU5CT1g%3D%3ANTYwNw%3D%3D%3AANSWERED&p=195&q=SHOW X-Is-Generated-Message-Id: true User-Agent: Android MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Local-Message-Id: <52767351-83da-41e2-a746-3407ee9c73e8@gmail.com> Content-Type: text/plain; charset=UTF-8 Subject: Re: Re: [PATCH] Fix mt7622.dtsi thermal cpu From: Eric Woudstra Date: Fri, 25 Jun 2021 13:07:42 +0200 To: Frank Wunderlich 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 Message-ID: <52767351-83da-41e2-a746-3407ee9c73e8@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I choose "hot* with CPU, because it was the best temperature=2E But it shou= ld really be passive only with the cooling device CPU but with a much highe= r temperature=2E For me 87 degrees is fine and tested=2E But for mainline w= e would better ask Mediatek for the correct maximum temperature=2E =E2=81= =A3Get BlueMail for Android =E2=80=8B On Jun 25, 2021, 1:03 PM, at 1:03 PM= , Frank Wunderlich wrote: >Hi > >> Gesendet: Fr= eitag, 25=2E Juni 2021 um 11:57 Uhr >> Von: "Daniel Lezcano" > >> You should not add the fan in the mt7622=2Edtsi itse= lf but in the board >> specific file where there is a fan output on it=2E m= t7622=2Edtsi is >supposed >> to be the SoC itself AFAICT=2E >> >> For insta= nce: >> >> >https://git=2Ekernel=2Eorg/pub/scm/linux/kernel/git/thermal/lin= ux=2Egit/tree/arch/arm64/boot/dts/rockchip/rk3399-sapphire=2Edtsi#n39 >> >>= >https://git=2Ekernel=2Eorg/pub/scm/linux/kernel/git/thermal/linux=2Egit/t= ree/arch/arm64/boot/dts/rockchip/rk3399-sapphire=2Edtsi#n164 > >> > @@ -170= ,14 +177,12 @@ >> > cooling-maps { >> > map0 { >> > trip =3D= <&cpu_passive>; >> > - cooling-device =3D <&cpu0 THERMAL_NO_LIMIT THER= MAL_NO_LIMIT>, >> > - <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; >> = > + cooling-device =3D <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; >> > = }; >> >> fan =3D=3D active trip point >> >> This is referring to the p= assive trip point=2E So it should point to >the >> CPU as it is now=2E Note= the order of mitigation is inverted regarding >the >> proposal description= =2E > >but we need to disable the passive trip as cpu-trotteling starts >th= ere=2E=2E=2Ethe higher temperature trips are currently not reached > >summa= ry > >moving fan and cpu_thermal-override to bananapi-r64=2Edts > >passive-= trip: cooling-device =3D <&cpu0/1 0 0> as in erics Patch >active trip: cool= ing-device =3D <&fan0 THERMAL_NO_LIMIT >THERMAL_NO_LIMIT>; >the other 2 unc= hanged > >but i suggest changing the temperature points in mt7622 dtsi as t= his is >SoC specific > >so basicly: > >--- a/arch/arm64/boot/dts/mediatek/m= t7622=2Edtsi >+++ b/arch/arm64/boot/dts/mediatek/mt7622=2Edtsi >@@ -143,13 = +143,13 @@ cpu_thermal: cpu-thermal { > > trips { > = cpu_passive: cpu-passive { >- = temperature =3D <47000>; >+ = temperature =3D <70000>; > = hysteresis =3D <2000>; > type = =3D "passive"; > }; > > = cpu_active: cpu-active { >- = temperature =3D <67000>; >+ tempera= ture =3D <80000>; > hysteresis =3D <= 2000>; > type =3D "active"; > = }; >@@ -170,8 +170,8 @@ cpu-crit { > = cooling-maps { > map0 { > = trip =3D <&cpu_passive>; >- = cooling-device =3D <&cpu0 >THERMAL_NO_LIMIT THERMAL_N= O_LIMIT>, >- <&cpu1 = >THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; >+ = cooling-device =3D <&cpu0 0 0>, >+ = <&cpu1 0 0>; > }; > > = map1 { >@@ -428,6 +428,7 @@ uart3: serial@110050= 00 { > pwm: pwm@11006000 { > compatible =3D "mediatek= ,mt7622-pwm"; > reg =3D <0 0x11006000 0 0x1000>; >+ = #pwm-cells =3D <3>; > interrupts =3D ; > clocks =3D <&topckgen CLK_TOP_PWM_SEL>, > = <&pericfg CLK_PERI_PWM_PD>, > >--- a/arch/arm64/boo= t/dts/mediatek/mt7622-bananapi-bpi-r64=2Edts >+++ b/arch/arm64/boot/dts/med= iatek/mt7622-bananapi-bpi-r64=2Edts >@@ -37,6 +37,13 @@ cpu@1 { > = }; > }; > >+ fan0: pwm-fan { >+ compatible= =3D "pwm-fan"; >+ #cooling-cells =3D <2>; >+ p= wms =3D <&pwm 2 10000 0>; >+ cooling-levels =3D <0 102 170 23= 0>; >+ }; >+ > gpio-keys { > compatible =3D "gp= io-keys"; > >@@ -582,6 +589,29 @@ &u3phy { > status =3D "okay"; > };= > >+&cpu_thermal { >+ cooling-maps { >+ map1 { >+ = trip =3D <&cpu_active>; >+ cooling-= device =3D <&fan0 THERMAL_NO_LIMIT >THERMAL_NO_LIMIT>; >+ }; = >+ }; >+}; >+ > &uart0 { > pinctrl-names =3D "default"; > = pinctrl-0 =3D <&uart0_pins>;