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 74D8EC433EF for ; Sun, 26 Jun 2022 17:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229468AbiFZRdS (ORCPT ); Sun, 26 Jun 2022 13:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231314AbiFZRdO (ORCPT ); Sun, 26 Jun 2022 13:33:14 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E271D765D for ; Sun, 26 Jun 2022 10:33:11 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id o16so9971216wra.4 for ; Sun, 26 Jun 2022 10:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=LVyzL8mphbtENNv7Ak5Yb4fzhkW9NpbRag7uI4Hacxc=; b=CixvAORRF/ukN2FEZzF3AXwjYn0QSsLkd38tK+4yJetZJEOD2q8BWdl+K7blkYG7QX PEpxd9kqTN2VWUXcz4YD/IK4r7df6FMK1XmJ0tM6GJBIgNOaTzoUXLdb0Hle84111G9o PEcdOK/tcVBUK/beyvIgVjBuqREmne+JuyFWCO/FfnY/agQm+R8Qf8mdpKl+YSiiVc6D warzD6uHfDCskO3OxQ41n/NxKpV0jX6Lm3HwMpdQWZangXskbf0W6LW/iOMuDxXv5+n9 tur8NsPqRiFwF1WgpEzx5KFrcp5JtHOeGJzYbiubnZrrT7cSPNOvq+v99yOHeGHnva84 muQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=LVyzL8mphbtENNv7Ak5Yb4fzhkW9NpbRag7uI4Hacxc=; b=sRLkYmtpv9rHoIbci52uJemo4udVGAjUXZ5mOjdVqRI+Yh/YsvHC+0pgpYuB/+Vp2N gD4mI6f8ZAvFy/BDOANZHb1AB4pk8Vlxvc+X8lDR1SA7dj2C+s43DJFq6Z0PhE0VMtS1 2QiHPb2EOW4Sv+bdKY/DNEumIfWi7ufgaB82eXFTyApnIeBhl2ImWD5BMFjFkDF7myzv UI21FJSwgm23CRaq/5MbWByccF0E+GCivpO6RBQWEsgqhNktEW8X86CqnKsWP/I7Ut3f vS6CMpokB1r1TXkN3bu7mwqTA7Iho/RQqDV4H27FJN+uOI5CPiHZ+0Po+TI+TDPQ1FAp JbDg== X-Gm-Message-State: AJIora9tJTqhrSuCNzGh9iNykENtdle62FtRRJ77yDETS9liDq9nc6vk jFGDjGvn8Qkcnq8yboTb71loki6Lm44rRg== X-Google-Smtp-Source: AGRyM1sT+QzEds/eFmu00keheN6WbaWKP57czuiPSPRTt3/jN3GsXQ0byLphmAqRpiPIai9t45cykg== X-Received: by 2002:a5d:6ac4:0:b0:21b:a724:1711 with SMTP id u4-20020a5d6ac4000000b0021ba7241711mr8495754wrw.80.1656264790204; Sun, 26 Jun 2022 10:33:10 -0700 (PDT) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id c11-20020a05600c0acb00b00397342e3830sm11310979wmr.0.2022.06.26.10.33.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Jun 2022 10:33:09 -0700 (PDT) Message-ID: <43b1c2fd-b746-84eb-c82b-23f1bd39242e@linaro.org> Date: Sun, 26 Jun 2022 19:33:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2 01/14] thermal/core: Change thermal_zone_ops to thermal_sensor_ops Content-Language: en-US To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Kevin Hilman , Alexandre Bailon , Linux PM , Linux Kernel Mailing List , Amit Kucheria , Zhang Rui , Jonathan Corbet , Len Brown , Raju Rangoju , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Ido Schimmel , Petr Machata , Luca Coelho , Kalle Valo , Peter Kaestle , Hans de Goede , Mark Gross , Sebastian Reichel , Miquel Raynal , Support Opensource , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Miri Korenblit , Johannes Berg , Srinivas Pandruvada , Sumeet Pawnikar , Dan Carpenter , Chuansheng Liu , Jiasheng Jiang , Antoine Tenart , Andy Shevchenko , "open list:DOCUMENTATION" , "open list:ACPI THERMAL DRIVER" , "open list:CXGB4 ETHERNET DRIVER (CXGB4)" , "open list:INTEL WIRELESS WIFI LINK (iwlwifi)" , "open list:ACER ASPIRE ONE TEMPERATURE AND FAN DRIVER" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "open list:RENESAS R-CAR THERMAL DRIVERS" References: <20220507125443.2766939-1-daniel.lezcano@linexp.org> <20220507125443.2766939-2-daniel.lezcano@linexp.org> From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, sorry for the delay, I was OoO. On 17/05/2022 17:42, Rafael J. Wysocki wrote: > On Sat, May 7, 2022 at 2:55 PM Daniel Lezcano wrote: >> >> A thermal zone is software abstraction of a sensor associated with >> properties and cooling devices if any. >> >> The fact that we have thermal_zone and thermal_zone_ops mixed is >> confusing and does not clearly identify the different components >> entering in the thermal management process. A thermal zone appears to >> be a sensor while it is not. > > Well, the majority of the operations in thermal_zone_ops don't apply > to thermal sensors. For example, ->set_trips(), ->get_trip_type(), > ->get_trip_temp(). The set_trips is necessary to set the sensor interrupt to fire when the trip temperature is crossed the way up or down. >> In order to set the scene for multiple thermal sensors aggregated into >> a single thermal zone. Rename the thermal_zone_ops to >> thermal_sensor_ops, that will appear clearyl the thermal zone is not a >> sensor but an abstraction of one [or multiple] sensor(s). > > So I'm not convinced that the renaming mentioned above is particularly > clean either. > > IMV the way to go would be to split the thermal sensor operations, > like ->get_temp(), out of thermal_zone_ops. Probably, we should first replace all the calls to ops->get_temp with a function. Then create the ops for the sensor: - get_trend - get_temp - set_trips - bind / unbind > But then it is not clear what a thermal zone with multiple sensors in > it really means. I guess it would require an aggregation function to > combine the thermal sensors in it that would produce an effective > temperature to check against the trip points. Yes, that is why the above ops->get_temp should be wrapped into a function which can evolve to an aggregation function. > Honestly, I don't think that setting a separate set of trips for each > sensor in a thermal zone would make a lot of sense. I agree the set_trips is for the interrupt mode only. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog