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 X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF50BC432BE for ; Fri, 20 Aug 2021 11:30:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA0236108B for ; Fri, 20 Aug 2021 11:30:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239687AbhHTLbJ (ORCPT ); Fri, 20 Aug 2021 07:31:09 -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-Google-Smtp-Source: ABdhPJxgiXh5Uwv9cgb9XBAyiujiZHro30bND8lWH4Gh5erzv2Oh3PODyusAuRD+3aJZyfhhVApvJQ== 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