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 21D5AC64ED8 for ; Thu, 23 Feb 2023 14:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234772AbjBWOgK (ORCPT ); Thu, 23 Feb 2023 09:36:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbjBWOgH (ORCPT ); Thu, 23 Feb 2023 09:36:07 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56B8858B7E for ; Thu, 23 Feb 2023 06:36:01 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id o14so9373168wms.1 for ; Thu, 23 Feb 2023 06:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5A8UeRr2Gc2z9WOFsL/7qhv/YNUuwYHZ6QFgk2PLkf4=; b=G/KnzB+TqsBI8cevd406M1H2uS/axQyn5O3J8LbGgYCVum00LDCUcdsLRO4e+PYdTW U53td03TDwO3oqU/DfyEACJp3u8kqk/fQs1hqFQfHLbFvVaGxAxtxfhj20dVBDn/KocL bRm4dGcQ8RneN0QZZOclkTDXg5Tz49YHzlv2KJwX01gmRldUTxSI9wx6CwNtT7JS4MpX XQc/ceZ/Ksf8XK7DsOO+WaVEgFWi4+WZcf9lLCMAByGprBtrAIY/OBJ06L3/FJ6oVN0s EtSN5c388v7cMmniaxK9MZ4F5hupqKl7pkEC/gfUk5A76nvfNX4TMsgdKEROOksO965j GZ+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5A8UeRr2Gc2z9WOFsL/7qhv/YNUuwYHZ6QFgk2PLkf4=; b=kfBjTSiDrL1VAUEWxJwZVkeSls2+P2pdT5zMX3u8+D8vQE2aAz/f1uk80w5LRVujfE Bro48HQYCRRp3g4LTDvNji8ec6APUO5mR1IwzVGr82TS/kNMzm6nfFIJPOkZWsNcL2jm pKBhO1ZJMBwbhLCApauaB/fS8JRSmY2xEbMxxiT7aDzXpQJ01kYH3JmY/wxJ3vlfGZb0 m50PrtAOiDiz6a9AUnbZQ7yvUK8Gl+YQtKbznr36o/O98j0t+7dqFT0YC46n+y7dCsPK zeUJg2omYx2JDqGFSEfti15JOGU+xn7mdtV/YqvvkkK5rR5muPYnqftRqbk7C96IYsHs D5Cg== X-Gm-Message-State: AO0yUKX8cUdhz6agPDUChxbiJDo3uqcbyDJYcLK4YlS/7iGHwu7/MYmI ZjpJmFRoyLnYjxecutiK2DrVKw== X-Google-Smtp-Source: AK7set8m6oTFiOFyJ69IZZpXnSY707D1wGVpzvSHc156iH26zK9yl1Et8LQfhfLoNB4CqfmWsB2ihw== X-Received: by 2002:a05:600c:43c9:b0:3e1:f8af:7942 with SMTP id f9-20020a05600c43c900b003e1f8af7942mr3008298wmn.22.1677162958724; Thu, 23 Feb 2023 06:35:58 -0800 (PST) Received: from ?IPV6:2a05:6e02:1041:c10:c265:a8c7:c71d:6e47? ([2a05:6e02:1041:c10:c265:a8c7:c71d:6e47]) by smtp.googlemail.com with ESMTPSA id n15-20020a05600c3b8f00b003e224ff61a8sm12388179wms.43.2023.02.23.06.35.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Feb 2023 06:35:58 -0800 (PST) Message-ID: Date: Thu, 23 Feb 2023 15:35:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v2 06/16] thermal: Don't use 'device' internal thermal zone structure field Content-Language: en-US To: "Rafael J. Wysocki" Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Balsam CHIHI , Amit Kucheria , Zhang Rui , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Eduardo Valentin , Keerthy , Matthias Brugger , AngeloGioacchino Del Regno , Ido Schimmel , Mark Brown , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "open list:TI BANDGAP AND THERMAL DRIVER" , "moderated list:ARM/Mediatek SoC support" References: <20230221180710.2781027-1-daniel.lezcano@linaro.org> <20230221180710.2781027-7-daniel.lezcano@linaro.org> <0889767f-d187-0cb4-895e-c149517b6636@linaro.org> <2b843912-cc9b-f1ac-1f81-28e3ecf8daba@linaro.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 On 23/02/2023 12:43, Rafael J. Wysocki wrote: > On Thu, Feb 23, 2023 at 10:56 AM Daniel Lezcano > wrote: >> >> On 22/02/2023 21:06, Rafael J. Wysocki wrote: >>> On Wed, Feb 22, 2023 at 9:00 PM Daniel Lezcano >>> wrote: >>>> >>>> On 22/02/2023 20:43, Rafael J. Wysocki wrote: >>>>> On Tue, Feb 21, 2023 at 7:07 PM Daniel Lezcano >>>>> wrote: >>>>>> >>>>>> Some drivers are directly using the thermal zone's 'device' structure >>>>>> field. >>>>>> >>>>>> Use the driver device pointer instead of the thermal zone device when >>>>>> it is available. >>>>>> >>>>>> Remove the traces when they are duplicate with the traces in the core >>>>>> code. >>>>>> >>>>>> Signed-off-by: Daniel Lezcano >>>>>> Reviewed-by: Balsam CHIHI #Mediatek LVTS >>>>>> --- >>>> >>>> [ ... ] >>>> >>>>>> thermal_zone_device_update(data->ti_thermal, THERMAL_EVENT_UNSPECIFIED); >>>>>> >>>>>> - dev_dbg(&data->ti_thermal->device, "updated thermal zone %s\n", >>>>>> + dev_dbg(data->bgp->dev, "updated thermal zone %s\n", >>>>>> data->ti_thermal->type); >>>>> >>>>> The code before the change is more consistent, because it refers to >>>>> the same object in both instances. >>>>> >>>>> It looks like a type field accessor is needed, eg. thermal_zone_device_type()? >>>>> >>>>> Or move the debug message to thermal_zone_device_update()? >>>> >>>> Actually it is done on purpose because the patch 9 replaces the accesses >>>> to 'type' by 'id', the thermal_zone_device_type() accessor won't be needed. >>> >>> Cool. >>> >>> However, this is a change in behavior (albeit small) which doesn't >>> appear to be necessary. >>> >>> What would be wrong with having a tz->type accessor too? >> >> I can add the 'type' accessor but from my point of view it is not >> correct because the information belongs to the thermal framework and it >> is used to export the information in the sysfs which is along with the >> directory name giving the id of the thermal zone. > > I'm not sure what you mean here. > > Surely, the 'type' is provided by whoever registers the thermal zone, > so I'm not sure in what way it "belongs" to the framework. I meant the goal of 'type' is to be exported to sysfs, nothing else. That is the reason why I used the word 'belongs', because it was introduced to stay in the scope of the thermal framework, but then its usage has been diverted to a name. Anyway, from my POV having traces in the ops is not a good thing, so I'll propose later to remove them and add a single message in the call sites. Meanwhile, I'll provide the accessor for 'type' and hopefully we do not end up with a plethora of accessors to be used in the core code. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog