From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB986C43217 for ; Thu, 20 Oct 2022 14:28:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229649AbiJTO2R (ORCPT ); Thu, 20 Oct 2022 10:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbiJTO2M (ORCPT ); Thu, 20 Oct 2022 10:28:12 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4B601ABA15 for ; Thu, 20 Oct 2022 07:28:09 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id r17so47798756eja.7 for ; Thu, 20 Oct 2022 07:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7QR1IqMPTQfafYMBcRZyO6+upzIaAEmghcFFaL+GXdY=; b=vegGHfEDzAlS0VlymlKs1Ypplgljzlzyspn1r1KOwHstsAMU9QtfZ18RgALUIIPhrZ yWprS/+oaZXitf5/ng9chHACmDYZusFYBdjlCm+SRcGUd6aBvlX+yCE1Qr0bzstWM9QF 0hOYwp5OOlmp4LNb8BEsmOWfMzexAfIjoEwuAXtK7vXZIjrj62Cqdm1dOTwrWeovIpnI qLQzmLeAjdcbjJ7GMQEGdXmPZIyraOUd26r9u53Mq7uolJggmiH0L+A3Xn86t9Mqn2tR XJReD5jrMuqINxnVCjQwZdyqKXhzmUq2kSSq24z6EJgyttB23Fi+INruZJw+dEQbHDRx i6mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=7QR1IqMPTQfafYMBcRZyO6+upzIaAEmghcFFaL+GXdY=; b=SfzD++6f2pXHN8UIPJ5y78f+mwFlELvfZf2DGPDefPyRxlzhB6lzNE90FSJ6l0mFnK aNJ/uTYSB0LHuXHsgUrfPTTtmoWp5dnrX90zpJUXGEplRxWCCDId+Vdbr0NGsVtq9GuR hE1SrXTBPfPDL8PjtCx1H9D+0YMtLZM3qiOndUoMbg5j3NANRZsYSBngMXHEIrUQRYKG UjNLRPj4PbfCU1NHtW7ft9Dvg/6wKqb8ah29QMuZigKItDUv7GFqZl8g5Wk7xK1TJFyx g3ZMmaDQ5Zd5pODrZBsnOBwxByJPEF51sbIwcwzc4guGs5Y0gydYb1ufs4H2GSDqY5Ak edyw== X-Gm-Message-State: ACrzQf3s6W/8qlTD/aRcUCQ4xNROjjv+jEFvxfWvL3K+jWCtPAlk6yHJ K4PqueXp6H6bCYvTU3VBaxlWuQ== X-Google-Smtp-Source: AMsMyM6c3vjC3h2UKyDABM7/Zth6iJYEdeiBBn9C/o6MJ8pVRnDGnQgdHus11l/HJYKNgBqDaxsozQ== X-Received: by 2002:a17:907:2e01:b0:78d:f24b:7330 with SMTP id ig1-20020a1709072e0100b0078df24b7330mr11097959ejc.604.1666276088208; Thu, 20 Oct 2022 07:28:08 -0700 (PDT) Received: from localhost (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id v1-20020a170906292100b0078116c361d9sm10614246ejd.10.2022.10.20.07.28.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Oct 2022 07:28:07 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 20 Oct 2022 16:28:07 +0200 Message-Id: Cc: "Krzysztof Kozlowski" , , <~postmarketos/upstreaming@lists.sr.ht>, , "Andy Gross" , "Bjorn Andersson" , "Konrad Dybcio" , "Rob Herring" , "Krzysztof Kozlowski" , , Subject: Re: [PATCH] arm64: dts: qcom: pm6350: add temp sensor and thermal zone config From: "Luca Weiss" To: "Matthias Kaehlcke" X-Mailer: aerc 0.12.0 References: <20220812114421.1195044-1-luca.weiss@fairphone.com> <81ae6a31-1f37-a677-f8f8-2340e37d3a63@linaro.org> In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Matthias, sorry for the delay in getting back to you. On Fri Aug 12, 2022 at 6:49 PM CEST, Matthias Kaehlcke wrote: > On Fri, Aug 12, 2022 at 04:06:47PM +0200, Luca Weiss wrote: > > Hi Krzysztof, > >=20 > > +CC Matthias Kaehlcke (author of patch mentioned further below) > >=20 > > 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. > > > >=20 > > > > Signed-off-by: Luca Weiss > > > > --- > > > > With this config I'm getting this in dmesg, not sure if it's a warn= ing > > > > that should be solved or just an informative warning. > > > >=20 > > > > [ 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. > > > >=20 > > > > As far as I can tell, based on downstream dts this PMIC doesn't hav= e an > > > > ADC. > > I don't seem to have access to the datasheet, in any case that the ADC is= n'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. Too bad :( > > > > You configure 145 and driver believes 140 is the limit, so it seems > > > warning should be addressed. > >=20 > > Hm... > >=20 > > > > > > From where did you get 145 degrees as limit? Downstream DTS? > >=20 > > Yes, downstream dts[0]. > >=20 > > From what I can see in the downstream driver, it always disabled this > > "software override of stage 2 and 3 shutdowns"[1] > >=20 > > 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. > >=20 > > Any suggestion what I can do here? Maybe looking at msm-5.4 sources (an= d > > associated dts) might reveal something..? > > I wouldn't necessarily consider QC downstream code as a reliable source o= f > 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 =3D 140 degC). PM6350 is detected as QPNP_TM_SUBTYPE_GEN2 so gen2 actually. Just the log message is hardcoded to 140 degC, the if above actually has stage2_threshold_max =3D 125000 (125degC) and stage2_threshold_min =3D 110000 (110degC) so lower than 140 (basically like you said). > > 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? Based on this, do you think it's reasonable to just set the limit to 125 degC and be done with it? Or some other way to resolve this? I'd of course mention in the commit message that I've decreased the value from 145 (msm-4.19) to 125. Regards Luca