Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1135759rwb; Sat, 13 Aug 2022 18:14:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR4vbRVg8GOh3bBK3YSB49rOZcv4Qj1BRxV7EVC1e3VzKH6hgxE2jj8g/x+f7slpr+mSd+2k X-Received: by 2002:a05:6402:43c4:b0:43b:c5eb:c9dd with SMTP id p4-20020a05640243c400b0043bc5ebc9ddmr9026410edc.402.1660439649512; Sat, 13 Aug 2022 18:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660439649; cv=none; d=google.com; s=arc-20160816; b=DIYB8xSYAPYmHNRNeh+uiW2TrTA6nfSmAn1x2yc8NOPL9ahYdv/xJHb+WmcDgMW9dj GV3YpBkdiDVli5i/MDsFWRok981fH3J+I2I9e10P/QV64gYPgoTd2+DVqd4C8f+ux6MB rTx7eAL4rTYKMWQtEjXKw+qhtmQJoTbNb7rvNvwOu9uXZp5HeE3dZ1wU/JKmJ5BxW0me nknX10kKpr0Wa2kM0/klJqE0sh9J82z8H0BfTIo1I/uazubJF9PIP9rx5K62ABCCJwxM 1DowHMve078CwUEAGwPXUZ9o2qGHMHJU3iHC+i2xRPP/ahqwienT3wa22lSNA0kQdcek LeNg== 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; bh=nLgFsUdTvrWzYmaOBDBSSPpa7enLx5WxwqMFuOC6YZo=; b=plJHZ0/5CqAln6ih9lZ6N7xG8zwot5+WadEAnfuQ6kG/A/P+K7kW6VVs8kigZ9Z1vE bfNUJ4SX5D2kgvuZZBv9Bpw6Bw35pHYuD7hgl51NzcYaBbXTEfOreSQk/EXS0hBZO+oU kkZWlKfNl7+g7ommZ9Z7NvbdI+jyxR6+cAk+KquAJpmhTGL6YkwxmjLYYZDWedqKFc4H 2Vg80ZXr+I5ZsPnKPB5k0hDWWdflVY2YNoqgBmsonmH9A7Eed/f/oo6Q7lBBwZZ+EK2R x8NoovO9zYjWzA8mHA/IUL99XnUAOpphhApk2bDq+7TgefXcYsCeaits9HB2OkO5qxDb zWnA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a056402090c00b0043df7e2a990si5996071edz.264.2022.08.13.18.13.43; Sat, 13 Aug 2022 18:14:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbiHNAmF (ORCPT + 99 others); Sat, 13 Aug 2022 20:42:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239787AbiHNAlv (ORCPT ); Sat, 13 Aug 2022 20:41:51 -0400 Received: from relay04.th.seeweb.it (relay04.th.seeweb.it [IPv6:2001:4b7a:2000:18::165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A0E78BFC; Sat, 13 Aug 2022 17:41:48 -0700 (PDT) Received: from [192.168.1.101] (abxi168.neoplus.adsl.tpnet.pl [83.9.2.168]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id 5ABC31F613; Sun, 14 Aug 2022 02:41:44 +0200 (CEST) Message-ID: Date: Sun, 14 Aug 2022 02:41:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] arm64: dts: qcom: pm6350: add temp sensor and thermal zone config Content-Language: en-US To: Matthias Kaehlcke , Luca Weiss Cc: Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220812114421.1195044-1-luca.weiss@fairphone.com> <81ae6a31-1f37-a677-f8f8-2340e37d3a63@linaro.org> From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 12.08.2022 18:49, Matthias Kaehlcke wrote: > On Fri, Aug 12, 2022 at 04:06:47PM +0200, Luca Weiss wrote: >> Hi Krzysztof, >> >> +CC Matthias Kaehlcke (author of patch mentioned further below) >> >> On Fri Aug 12, 2022 at 3:36 PM CEST, Krzysztof Kozlowski wrote: >>> On 12/08/2022 14:44, Luca Weiss wrote: >>>> Add temp-alarm device tree node and a default configuration for the >>>> corresponding thermal zone for this PMIC. Temperatures are based on >>>> downstream values. >>>> >>>> Signed-off-by: Luca Weiss >>>> --- >>>> With this config I'm getting this in dmesg, not sure if it's a warning >>>> that should be solved or just an informative warning. >>>> >>>> [ 0.268256] spmi-temp-alarm c440000.spmi:pmic@0:temp-alarm@2400: No ADC is configured and critical temperature is above the maximum stage 2 threshold of 140 C! Configuring stage 2 shutdown at 140 C. >>>> >>>> As far as I can tell, based on downstream dts this PMIC doesn't have an >>>> ADC. > > I don't seem to have access to the datasheet, in any case that the ADC isn't > configured in the downstream dts doesn't necessarily mean the PMIC doesn't > have one. The PM6150 has one, and it is probably relatively close to the > PM6350. > >>> You configure 145 and driver believes 140 is the limit, so it seems >>> warning should be addressed. >> >> Hm... >> >>> >>> From where did you get 145 degrees as limit? Downstream DTS? >> >> Yes, downstream dts[0]. >> >> From what I can see in the downstream driver, it always disabled this >> "software override of stage 2 and 3 shutdowns"[1] >> >> In mainline only since f1599f9e4cd6 ("thermal: qcom-spmi: Use PMIC >> thermal stage 2 for critical trip points") this check exists, which is >> not part of downstream (wasn't in 4.19 yet), where this software >> override tries to get enabled so that thermal core can handle this. >> >> Any suggestion what I can do here? Maybe looking at msm-5.4 sources (and >> associated dts) might reveal something..? > > I wouldn't necessarily consider QC downstream code as a reliable source of > truth ... > >> Maybe newer SoCs/PMICs have a different config? > > Commit aa92b3310c55 ("thermal/drivers/qcom-spmi-temp-alarm: Add support > for GEN2 rev 1 PMIC peripherals") added support for gen2 PMICs, which > actually have lower thresholds than gen1. From the log it seems that the > PM6350 is identified as gen1 device (max stage 2 threshold = 140 degC). > > It seems setting the limit to 140 degC or one of the other stage 2 > thresholds would be a reasonable course of action. stage 2 is the > threshold at which the PMIC is so hot that the system should shut > down, and 140 degC is the highest of the stage 2 thresholds. Even > if it was possible, what would be gained from setting the trip > point 5 degC higher? Eeeh, if it ran at anything near that for prolonged time, the heat would likely spread around the device causing the battery to eventually combust.. Qualcomm DTs say one thing, but vendor userspace daemons are far more conservative. Not sure if they're still around (should be iirc), but I would definitely object allowing anything inside [mainly] mobile devices to reach that kind of temperature.. Konrad