Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1388950pxb; Fri, 20 Aug 2021 04:37:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySJC2t2UMXOI9wxG5AsyTpEc958DaSSN8DrEzfqIAxR7njCaJrNk8ERl/TBwG/jmeTu0FM X-Received: by 2002:a17:906:ad7:: with SMTP id z23mr21648773ejf.419.1629459447603; Fri, 20 Aug 2021 04:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629459447; cv=none; d=google.com; s=arc-20160816; b=A3xrQMe+67gTPMhhRfsWjeS5xY6ChJ5QS7SqIRW7Q/eJZkLQu3WCF4asTNM7kNX4tH J7U53ycHqY6cAM4rF3h3rp5x82/u4L5b/zgjKytfhTJwjJU91NZ/6hQsPudJgS1nGZDH +gUNKOx6kI/Pagf/If5l850Yob5DzSPJag/vajIDWhwQ/4P8QEQdyDbLrOvB+EOp8GMG I969KIHTnjIi+h14VX+CmEzT1b2qNyWsqLFbcb2SKRBV7xnHsRPE36GKsBMIKHFkbo6D zsJJ1iRlvpQRRGYf53jLdAX5ioQhuF81sw41FYthqUgg/sXSPWlc7r1EFgx++VthgUEA D5BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=qDKfRZRU7nzYZWhRJJ9/0dIDBxxKxoJMevlwhIQ2MBE=; b=nGYP4qlcqnIzHjV3FY/fgZneP0G8w/QfKHaUy2VUabQEOGGNftdv3/nItSgZv1NeEm bpsufzxRcsOq9nkK5cO6XDJC6gjjzxY351SMWxRQBEY/Q22rJ50bek0RUMatYaZ8z7mT A7qyKA2sqgkCNGySY9WqDGLkGX9WBdt98sRHt0BtFwOTNrKaSWbUKMcF4kCAhpGHlHl4 Vn2IpM86+kUp0LQoXiEM541IpRP3poMEmD/SkPksLq8udBInw2oiF/GN9EeIJC19HTWS yhe67bMqhkTXcVGAomFhZfEAT5i0cAgTbezLMEX/XPTg7ozUcnD2/cF5mm/3yMCP3PAj jw8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9ZRFlHl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs35si5755386ejc.358.2021.08.20.04.36.44; Fri, 20 Aug 2021 04:37:27 -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=pass header.i=@linaro.org header.s=google header.b=K9ZRFlHl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238769AbhHTLbI (ORCPT + 99 others); Fri, 20 Aug 2021 07:31:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239511AbhHTLbI (ORCPT ); Fri, 20 Aug 2021 07:31:08 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 934DAC061756 for ; Fri, 20 Aug 2021 04:30:30 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id k8so13788727wrn.3 for ; Fri, 20 Aug 2021 04:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qDKfRZRU7nzYZWhRJJ9/0dIDBxxKxoJMevlwhIQ2MBE=; b=K9ZRFlHl8vmyynKsEHwmhmZn0L2EbAYxMEMV/C4Vbc5Qe4HOZC6X+5qWCoBXRa1xKB bBH71UNA71ckpnPSCf4XjKX1WTOkG/1ASY6fGe51D5of8fPZ9Q+HBcx/WIZycmN1PBuK K1bTez5YaDVNTYpDAMfkGm9FMzEJQ6/yAtxrtY2Gag3iZpE6oAHM+BaBadhpFlMUrhaG NpjUALqy+A0xidp/HSgA3n7AjGS3qVvQytL0ErA07LSRqGgCs7VKwHAq5dcInFZ5qb5K 8YGP7znljbcJEFBBbZvHijsJrFGCGOSTYMvu0gmALqNVTXD0BOqza24oJ4G0yLMgq3Po upSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qDKfRZRU7nzYZWhRJJ9/0dIDBxxKxoJMevlwhIQ2MBE=; b=sUCXMNyuhyotwXEnGiAt8QESF2ovYydurcLBUErY9jC86YZOEGUaKxjKUB6xalM+cc dv5tuTSPPwGyd8VqBLv319XvTWnNOhG/pvDXuaBl1ZA71vchHnvjNKi92EpGjnw9u1Vf YSP0QfjYqdbiqv7sCFzMj7vgvwPNXSED71jEMWkALY+c00U7FcGvafjGtaTORzqiqvol cxlXijwNefPLTFx318Aw5WslgteH5E9eX95ozvli2ZkImvTp2OqiNNIO+eKU6l3jVOGY rumdvY19TjCJnKb7xjjqLmJHIalyp2wCSOlSAbNucuphkE4MZBzex5cZQDj3zYeP6yX3 cr/g== X-Gm-Message-State: AOAM5310xKZs7XBi/d7HyHoGkHIemnBOA2H2Lkq0Hn0L9eK8o7SWAtXN 7825cZpa8dIP4C45vrJX/xrSxw== X-Received: by 2002:adf:f0c2:: with SMTP id x2mr9412185wro.107.1629459028907; Fri, 20 Aug 2021 04:30:28 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:c378:b01b:5d2d:5223? ([2a01:e34:ed2f:f020:c378:b01b:5d2d:5223]) by smtp.googlemail.com with ESMTPSA id h11sm11696878wmc.23.2021.08.20.04.30.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Aug 2021 04:30:28 -0700 (PDT) Subject: Re: [RFC PATCH 0/2] Add a generic virtual thermal sensor To: Alexandre Bailon , rui.zhang@intel.com, amitk@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, ben.tseng@mediatek.com, khilman@baylibre.com References: <20210819123215.591593-1-abailon@baylibre.com> From: Daniel Lezcano Message-ID: Date: Fri, 20 Aug 2021 13:30:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210819123215.591593-1-abailon@baylibre.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, thanks for the proposal. On 19/08/2021 14:32, Alexandre Bailon wrote: > This series add a virtual thermal sensor that uses the hardware thermal sensors, > aggregate them to return a temperature. > > My first aptempt was to do the aggregation in the thermal zone but it was not > that easy to do, and, there were some case that would have been conflictual > such as setting differents trip for a regular zone and a multisensor zone. > > Instead, I made a virtual thermal sensor that could registered in a thermal > zone, and have its own properties. > It could be added in the device tree, with the list of sensors to aggregate, > and the type of aggregation to be done. > > As example: > soc_max_sensor: soc_max_sensor { > compatible = "generic,thermal-aggregator"; > #thermal-sensor-cells = <1>; > type = "max"; > thermal-sensors = <&lvts 0>, <&lvts 1>, <&lvts 2>, <&lvts 3>, > <&lvts 4>, <&lvts 5>, <&lvts 6>, <&lvts 7>, > <&lvts 8>, <&lvts 9>, <&lvts 10>, <&lvts 11>, > <&lvts 12>, <&lvts 13>, <&lvts 14>, <&lvts 15>, > <&lvts 16>; > }; > > The current series build and work but it would require to be completed > aswell a lot of cleanup. > Before working on it, I would like to get some feedback and I know if that > would an acceptable solution and continue that way. Yes, I think it is going to the right direction. IMO, we can get rid of the thermal_of changes. From a design PoV, the patch itself should be the virtual thermal driver without any changes in the core code, including thermal_of. I have some comments on patch 2/2 > Follows the following discussion: > https://patchwork.kernel.org/project/linux-mediatek/patch/20210617114707.10618-3-ben.tseng@mediatek.com/ > > Alexandre Bailon (2): > thermal: provide a way to get thermal sensor from a device tree node > thermal: add a virtual sensor to aggregate temperatures > > drivers/thermal/Kconfig | 8 ++ > drivers/thermal/Makefile | 1 + > drivers/thermal/thermal_aggregator.c | 134 +++++++++++++++++++++++++++ > drivers/thermal/thermal_of.c | 43 +++++++++ > include/linux/thermal.h | 12 +++ > 5 files changed, 198 insertions(+) > create mode 100644 drivers/thermal/thermal_aggregator.c > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog