Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp943683pxb; Wed, 6 Apr 2022 05:00:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwppzySe07zaXljbgfP8gFB2i+3ASV/MOsqhwkVyy7tRjixNdXw1gOEPfUK20knblSh4JRk X-Received: by 2002:a17:90b:3b50:b0:1c7:5d55:3cb8 with SMTP id ot16-20020a17090b3b5000b001c75d553cb8mr9577022pjb.78.1649246432327; Wed, 06 Apr 2022 05:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246432; cv=none; d=google.com; s=arc-20160816; b=iadTPRp0ZJTspcjp/nwi8GzBV6WCgKDfU7EkzqWsNJZWcSe4Kmru/JNq/O6txFwkXE KNLc6cB/PP5/4KBuysPpd1YknK4cikzs3t0vWrWTQr2jQtYiszoOHIZeLjD3Jdx2Jj4C 6kZ9jrPuryn0MHdCzeo+WWPIxd+Rgq44K0DCnmbN6tVOrEeTd05gHrZHDq7tQvqZn5IX f9+lTWPFpDjx3Tm21J23hxSR42Zjems9QKCp8e22/jpqaBY8yvpxAEQSxuQSJbdYnWyD wCoMkRd3oskHm9Ozia2Gzu0bRSdO9RMXwxUI6+qY9kdzscEEh6mY6493hc73IfkW9Us+ 8R4Q== 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=YeUwp0HvHeI6Ps4hcVHXLzuuvuP8/QGegJNvp/ET4x4=; b=UbOzsoOBMaSmihiqTUOYzHz6BHaPKAyTUlEn8mWUjLq1RiSil2BSpCt2dM2xmA6rtl B/mpyoEf47De2fZMrNo8+gQNlnK4/cmTAyMxBleFSCb79E6GIF0zHLBF8tKeMdxpix06 Ecckz6y9B7o3P2QAe3P78wCH3w2j7Rp+IsumN203rY2M+Gf5zxhqQGKhgx8oDofoKtxu etrWhMaY10l0U2ftnVDIs92t7bD269E4zh8cdbHEer/KlrU7PJgm/xaa+tj6D3SdGmm1 ks5uXBmB80iDDMxVT7P+pMNW0iM047ymW+ZY5psNCCYMA/tNyom/+iiCtKIoFAvHvQhC jCEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Bwg80AKV; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u11-20020a170902e5cb00b001541c9df632si17766378plf.400.2022.04.06.05.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:00:32 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Bwg80AKV; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8E4B1346E78; Wed, 6 Apr 2022 03:23:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443235AbiDEWUP (ORCPT + 99 others); Tue, 5 Apr 2022 18:20:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379324AbiDENNn (ORCPT ); Tue, 5 Apr 2022 09:13:43 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AABD6366B6; Tue, 5 Apr 2022 05:14:52 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id DB32E1F42AF3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649160890; bh=5htqzeboi78pw+EZSDMSeRcR1q+P7L+C7qMifFBCIkg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Bwg80AKVhxXtveM6MoDiSFvGSKmbnOcjJT9oyUjIkBzLWKj2Z4ENiBNWEpciMwmxM Bztv6v0Xd8NraKnqMsJLeGVP+p9/kfkureZOEqQf1HQ0nM072ezuYyzGEWfYRMqHlp YFRaQFcGWB3XoDRNOoshBi8QWLQxrfOSvtluSGGYN0wHeHJ9bBblII9nEQg49ZyowC Vqu7VJKBEbADrq7EqsTHx13njjGUmwjRIQmiGG2QaBlrXGuJvXE5Q1pmNwyn6R3Cxe 0S4G2WJKxdqrc/I0i/JV5WzxhFu86RESUM3v9HS1SyojOV8xRpx7o477YJ7Y6H30bz ggiyeeqYr4EXw== Message-ID: Date: Tue, 5 Apr 2022 14:14:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 0/2] thermal: Add support of multiple sensors Content-Language: en-US To: Kevin Hilman , Eduardo Valentin , Alexandre Bailon , daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, amitk@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, ben.tseng@mediatek.com, mka@chromium.org, Marijn Suijten , Konrad Dybcio References: <7hlex0s6ag.fsf@baylibre.com> From: AngeloGioacchino Del Regno In-Reply-To: <7hlex0s6ag.fsf@baylibre.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 Il 23/03/22 22:33, Kevin Hilman ha scritto: > Hi Eduardo, Daniel, > > Eduardo Valentin writes: > >> On Fri, Feb 18, 2022 at 09:46:02AM +0100, Alexandre Bailon wrote: >>> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. >>> >>> >>> >>> Following this comment [1], this updates thermal_of to support multiple >>> sensors. >>> >>> This has some limitations: >>> - A sensor must have its own termal zone, even if it is also registered >>> inside a thermal zone supporting multiple sensors. >>> - Some callbacks (such as of_thermal_set_trips) have been updated to support >>> multiple sensors but I don't know if this really make sense. >>> - of_thermal_get_trend have not been updated to support multiple sensors. >>> This would probably make sense to support it but I am not sure how to do it, >>> especially for the average. >> >> Great to see this having somewhat a form now! >> >> Overall the idea is sane and aligned to what I had in mind back during the 2019 Linux plumbers: one thermal zone should have multiple sensor inputs. >> https://lpc.events/event/4/page/34-accepted-microconferences#PMSummary >> >> In fact, that is aligned to what I originally wrote in the thermal device tree bindings: >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/thermal/thermal-zones.yaml#n79 >> >> The only major concern with your series is the usage of of-thermal to achieve the multiple sensors per thermal zone. >> While that solves the problem, it has the following limitations: >> (1) limited to devices described in device tree. everybody else is left out. >> (2) it keeps extending the code duplication in of-thermal. >> >> My suggestion here is have the thermal core aware of the multiple sensors per thermal zone. >> >> That has the advantage of: >> (a) cleanup the sensor handling within of-thermal >> (b) expand the multi sensor per zone to all types of thermal drivers >> (c) standardize the way to handle the multi sensor. > > This cleanup all sounds like the right direction to be headed, but since > this has been planned since 2019 and nothing has happended, what is the > level of urgency is for this of-thermal -> thermal core cleanup/rework? > > In $SUBJECT series, we have a fully functional series that solves an > existing problem and takes a big step in the right long-term direction. > While it indeed has the has limitations you mention, I don't think that > should block the merging of this series. More importantly, there are > existing drivers[1] as well as forthcoming ones from MTK that depend on > this series. Those are blocked if you require the of-thermal -> core > move first. > > As a maintainer also, I fully understand that maintainer bandwith is > limited, and it's always nice to have contributors do core framework > development when possible, but IMO, in this case I don't think it should > be a prerequisite since a follow-up series to do the core work would not > affect any functionality or bindings etc. I don't see any reasons not > do to this incrementally. > > So I would kindly request (read: beg, plead & grovel) that you seriously > consider merging this series as a first phase and the of-thermal -> core > change be done as a second phase. Yes, I fully understand that punting > this to a second phase means it might not get done soon. But it's been > waiting for years already, so it seems the urgency is low. Meanwhile, > there are OF users that are ready to use this feature today. > > Thanks for considering, > > Kevin > > [1] https://lore.kernel.org/linux-mediatek/20210617114707.10618-1-ben.tseng@mediatek.com/ > > Hello Eduardo, Kevin, I would like to add that this series is not only benefitting MediaTek platforms, and not only Chromebooks. On some Qualcomm SoCs (from SDM845 onwards, if I'm not wrong!), downstream, there is some "qti virtual sensor" driver, which is addressing this kind of situation: on these platforms, averaging, min and max (and some interpolation too, but that's another story, I guess) is happening and that's used as some advanced way to ensure that both performance stays high and that the device is safe to operate. On these platforms, this is done by evaluating CPU, GPU, Hexagon DSPs, modem, wifi and (modem,wifi)PA IPs and deciding on a thermal throttling strategy. You understand that, while this is not "excessively" important for a Chromebook, which is a laptop, it may become even a safety concern in devices of other form factor, like smartphones, where there is a very strict thermal headroom (hence requiring a fine grained thermal management). Even though, on MediaTek, I guess that the primary usecase is Chromebooks and this kind of mechanism is required primarily for the LVTS sensors that are used for SVS calculations (read: better power efficiency), the Linux community is huge - and, with this kept in mind, there will probably be someone that will like to upstream their MTK smartphone for a reason or another (I think! This happened with Qualcomm so I guess that it's going to happen with "any other thing")... and that adds up to this problem being a safety concern to fix. Of course, I agree with you, Eduardo, about the needed cleanup but, for all of the aforementioned reasons - mine and Kevin's, like him, I would also beg, plead and grovel that you consider merging this series as a first phase, and accept the cleanup and use-case expansion as a second phase. P.S.: I'm adding Marijn and Konrad to the loop, as people interested to the Qualcomm side of things, and mainly upstreaming smartphones. Kind regards, Angelo