Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5243200rwr; Mon, 24 Apr 2023 00:44:43 -0700 (PDT) X-Google-Smtp-Source: AKy350a14tplQlKI6fn7CQI/Ag1mv+cJjL36K3K/5bhEFx9zJln0lvf9T45ZOcpnXFqM241yjMlt X-Received: by 2002:a17:903:1249:b0:1a6:b140:9d2 with SMTP id u9-20020a170903124900b001a6b14009d2mr16933142plh.61.1682322283501; Mon, 24 Apr 2023 00:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682322283; cv=none; d=google.com; s=arc-20160816; b=Nly5NKMw7uSuXr+OLwZT+suCpSwoeMBdgeuf/GmovP1/RbjmO3+ZMBd8wynbMcSPyJ +1+hPdP95caDd6kS7dK6H906dmljGn9OosNxny1qMTLXFx64D1/WyHvr2on1Kef21jqW 17YYiWK04xceIcGQBe86fusUinZlAJ2691jlwPJk0o3UvZuMD0PJt3IxNwsXoic2vMiq UfauTL16wkCwGXORwoaJUudgxdceGSFoO0QGIIc3FIrzk2urN6hfqg81ehIvRnpGlGzZ CvADGJ0xhR9VX4Mmn7rSdiAlfg62js3AjLTokyzstxJkWJyK55cvMHAIyTxGgeJmkJbA h+WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=FmAw5jSKSFxbzKFICaohcNFnFZEV2JoB4WCulCZTz2o=; b=xKA8MJXYOTG5sAl+39BiGNtKL1ZeqOGHzaUg1aZHRaIX4csr/NV6OWG+ddimmgyVkn tcx3GSIrucplL76JnAu6+Sofr+bMUm4n4mNBNZCvAfpzWTVy6ANf/Q2YPjSrqYrhIALe RtCLQ3hnfJvoG+/NAo8zuAxmnjh5Gi9N4Vjk9tuwGI/W8XCHia4/9yGYjRGDFKSw0zvY wEC17ITg9FGmhqMG6bOPlJkJTusPBtqgBT/+CdpZlx6r1nxHYbhRjC6r9l4qtt7SVE4G bdum6X1tX1XlsB8Hq0tyDNl1VxRrSQIaPZpVfD2ZYnJr0nwPZYDHfvpdRJUEuCoolbPz mmfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="D8MC/8sP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mq11-20020a17090b380b00b002475bc0a186si14095165pjb.69.2023.04.24.00.44.28; Mon, 24 Apr 2023 00:44:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="D8MC/8sP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231400AbjDXHks (ORCPT + 99 others); Mon, 24 Apr 2023 03:40:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbjDXHkr (ORCPT ); Mon, 24 Apr 2023 03:40:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B595AE7D; Mon, 24 Apr 2023 00:40:40 -0700 (PDT) Received: from [IPV6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2] (unknown [IPv6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 762376602097; Mon, 24 Apr 2023 08:40:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1682322039; bh=cIDw4bo9W+NAgm/8tIV6FQYtHcogF7cLjrNY/+Ashgw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=D8MC/8sP905WNAn7bhbIwt6KyjAWrgo2x9YsbL7az82njzG/qtsobZjNCF5xglABp a+nQyw49M6WSnt5HIDxOlUKYe07CTLXfMjIYwbbChP4CPvfYLHnumLoLLNFUZgOI83 ldsjmH82nfEUnVrYN6LJ3xsqwbepHq+Ab/YpfP0IOEcarSvkBvkTeG58uXbTReFCSm 5su4HEaXF+mAt6ttMSRm1Gdf+5ufboXqJJKi230YGS/BgDsKr8UT6fE1wkyx0FyByf juwIMtwikknFy0Tr5b0+waEFwaScP7CZSOx7gcLFlGJ6XoibB4i7Y+wuIrOlLh0Wy/ zoXJhUGLwUFPA== Message-ID: Date: Mon, 24 Apr 2023 09:40:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration Content-Language: en-US To: Chen-Yu Tsai Cc: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , matthias.bgg@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com References: <20230420094433.42794-1-angelogioacchino.delregno@collabora.com> <20230420094433.42794-2-angelogioacchino.delregno@collabora.com> <5ede9421-54d6-4dda-91af-2acbf46c2d3e@notapiano> <097d60ba-5604-a2c9-c6d2-121db2d55e36@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 24/04/23 09:38, Chen-Yu Tsai ha scritto: > On Mon, Apr 24, 2023 at 2:31 PM AngeloGioacchino Del Regno > wrote: >> >> Il 21/04/23 22:53, Nícolas F. R. A. Prado ha scritto: >>> On Fri, Apr 21, 2023 at 03:37:52PM +0800, Chen-Yu Tsai wrote: >>>> On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno >>>> wrote: >>>>> >>>>> This platform has three auxiliary NTC thermistors, connected to the >>>>> SoC's ADC pins. Enable the auxadc in order to be able to read the >>>>> ADC values, add a generic-adc-thermal LUT for each and finally assign >>>>> them to the SoC's thermal zones. >>>>> >>>>> Signed-off-by: AngeloGioacchino Del Regno >>>>> --- >>>>> .../boot/dts/mediatek/mt8195-cherry.dtsi | 105 ++++++++++++++++++ >>>>> 1 file changed, 105 insertions(+) >>>>> >>>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi >>>>> index 8ac80a136c37..0820e9ba3829 100644 >>>>> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi >>>>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi >>>>> @@ -114,6 +114,77 @@ ppvar_sys: regulator-ppvar-sys { >>>>> regulator-boot-on; >>>>> }; >>>>> >>>>> + /* Murata NCP03WF104F05RL */ >>>>> + tboard_thermistor1: thermal-sensor-t1 { >>>>> + compatible = "generic-adc-thermal"; >>>>> + #thermal-sensor-cells = <0>; >>>>> + io-channels = <&auxadc 0>; >>>>> + io-channel-names = "sensor-channel"; >>>>> + temperature-lookup-table = < (-10000) 1553 >>>>> + (-5000) 1485 >>>>> + 0 1406 >>>>> + 5000 1317 >>>>> + 10000 1219 >>>>> + 15000 1115 >>>>> + 20000 1007 >>>>> + 25000 900 >>>>> + 30000 796 >>>>> + 35000 697 >>>>> + 40000 605 >>>>> + 45000 523 >>>>> + 50000 449 >>>>> + 55000 384 >>>>> + 60000 327 >>>>> + 65000 279 >>>>> + 70000 237 >>>>> + 75000 202 >>>>> + 80000 172 >>>>> + 85000 147 >>>>> + 90000 125 >>>>> + 95000 107 >>>>> + 100000 92 >>>>> + 105000 79 >>>>> + 110000 68 >>>>> + 115000 59 >>>>> + 120000 51 >>>>> + 125000 44>; >>>>> + }; >>>>> + >>>>> + tboard_thermistor2: thermal-sensor-t2 { >>>>> + compatible = "generic-adc-thermal"; >>>>> + #thermal-sensor-cells = <0>; >>>>> + io-channels = <&auxadc 1>; >>>>> + io-channel-names = "sensor-channel"; >>>>> + temperature-lookup-table = < (-10000) 1553 >>>>> + (-5000) 1485 >>>>> + 0 1406 >>>>> + 5000 1317 >>>>> + 10000 1219 >>>>> + 15000 1115 >>>>> + 20000 1007 >>>>> + 25000 900 >>>>> + 30000 796 >>>>> + 35000 697 >>>>> + 40000 605 >>>>> + 45000 523 >>>>> + 50000 449 >>>>> + 55000 384 >>>>> + 60000 327 >>>>> + 65000 279 >>>>> + 70000 237 >>>>> + 75000 202 >>>>> + 80000 172 >>>>> + 85000 147 >>>>> + 90000 125 >>>>> + 95000 107 >>>>> + 100000 92 >>>>> + 105000 79 >>>>> + 110000 68 >>>>> + 115000 59 >>>>> + 120000 51 >>>>> + 125000 44>; >>>>> + }; >>>>> + >>>>> usb_vbus: regulator-5v0-usb-vbus { >>>>> compatible = "regulator-fixed"; >>>>> regulator-name = "usb-vbus"; >>>>> @@ -260,6 +331,10 @@ &gpu { >>>>> mali-supply = <&mt6315_7_vbuck1>; >>>>> }; >>>>> >>>>> +&auxadc { >>>>> + status = "okay"; >>>>> +}; >>>>> + >>>>> &i2c0 { >>>>> status = "okay"; >>>>> >>>>> @@ -1098,6 +1173,36 @@ mt6315_7_vbuck1: vbuck1 { >>>>> }; >>>>> }; >>>>> >>>>> +&thermal_zones { >>>>> + soc_area_ntc { >>> >>> Not sure if that's what's causing the issue, but the thermal zone name should >>> end with -thermal as per the binding. Also note that it needs to be under 20 >>> characters otherwise it will fail to be registered with -22 like below. >>> (Also, node names shouldn't contain underscore) >>> >>> Thanks, >>> Nícolas >>> >>>>> + polling-delay = <1000>; >>>>> + polling-delay-passive = <250>; >>>>> + thermal-sensors = <&tboard_thermistor1>; >>>>> + >>>>> + trips { >>>>> + trip-crit { >>>>> + temperature = <95000>; >>>>> + hysteresis = <2000>; >>>>> + type = "critical"; >>>>> + }; >>>>> + }; >>>>> + }; >>>>> + >>>>> + pmic_area_ntc { >>>>> + polling-delay = <1000>; >>>>> + polling-delay-passive = <0>; >>>>> + thermal-sensors = <&tboard_thermistor2>; >>>>> + >>>>> + trips { >>>>> + trip-crit { >>>>> + temperature = <95000>; >>>>> + hysteresis = <2000>; >>>>> + type = "critical"; >>>>> + }; >>>>> + }; >>>>> + }; >>>> >>>> I'm still getting: >>>> >>>> thermal_sys: Failed to find 'trips' node >>>> thermal_sys: Failed to find trip points for thermal-sensor-t1 id=0 >>>> generic-adc-thermal thermal-sensor-t1: Thermal zone sensor register failed: -22 >>>> generic-adc-thermal: probe of thermal-sensor-t1 failed with error -22 >>>> thermal_sys: Failed to find 'trips' node >>>> thermal_sys: Failed to find trip points for thermal-sensor-t2 id=0 >>>> generic-adc-thermal thermal-sensor-t2: Thermal zone sensor register failed: -22 >>>> generic-adc-thermal: probe of thermal-sensor-t2 failed with error -22 >>>> thermal_sys: Failed to find 'trips' node >>>> thermal_sys: Failed to find trip points for thermal-sensor-t3 id=0 >>>> generic-adc-thermal thermal-sensor-t3: Thermal zone sensor register failed: -22 >>>> generic-adc-thermal: probe of thermal-sensor-t3 failed with error -22 >>>> >> >> I think you have something wrong locally - there's no thermal-sensor-t3 in this >> devicetree... > > I seem to have run a stale kernel image. Rebuilt the kernel and everything > seems to work OK now. > > BTW, I think the design went for a lower trip point. At least the hardware > thermal protection IC on the Acer device trips at 85 degrees C, instead of > 95 degrees C. Maybe that's accounting for the fact that these are external > thermal sensors and have some latency and temperature difference. The PMIC > specifies 85 degrees C maximum ambient air temperature. The SoC doesn't > specify. > Let's play safe then, I'll change that to 85 for the next version. > Either way this is > > Tested-by: Chen-Yu Tsai > Reviewed-by: Chen-Yu Tsai Thanks!