linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Balsam CHIHI <bchihi@baylibre.com>,
	Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Keerthy <j-keerthy@ti.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>,
	Ido Schimmel <idosch@nvidia.com>, Mark Brown <broonie@kernel.org>,
	"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
	<linux-arm-kernel@lists.infradead.org>,
	"open list:TI BANDGAP AND THERMAL DRIVER" 
	<linux-omap@vger.kernel.org>,
	"moderated list:ARM/Mediatek SoC support" 
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v2 06/16] thermal: Don't use 'device' internal thermal zone structure field
Date: Thu, 23 Feb 2023 10:56:02 +0100	[thread overview]
Message-ID: <2b843912-cc9b-f1ac-1f81-28e3ecf8daba@linaro.org> (raw)
In-Reply-To: <CAJZ5v0h=UCOyJ88UgEdqch4NZK+DaT8jWnDaguQGNx-KOMhPPA@mail.gmail.com>

On 22/02/2023 21:06, Rafael J. Wysocki wrote:
> On Wed, Feb 22, 2023 at 9:00 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> On 22/02/2023 20:43, Rafael J. Wysocki wrote:
>>> On Tue, Feb 21, 2023 at 7:07 PM Daniel Lezcano
>>> <daniel.lezcano@linaro.org> 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 <daniel.lezcano@linaro.org>
>>>> Reviewed-by: Balsam CHIHI <bchihi@baylibre.com> #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.

Actually, the useful information is the id of the thermal zone, not the 
type. This one can be duplicate, for instance:

cat /sys/class/thermal/thermal_zone*/type
acpitz
acpitz

Given there are few places where 'type' is used in the drivers, I prefer 
to directly change that to 'id' in the next patch instead of creating 
the accessor for 'type', then send another series removing it.


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


  reply	other threads:[~2023-02-23  9:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 18:06 [PATCH v2 00/17] Self-encapsulate the thermal zone device structure Daniel Lezcano
2023-02-21 18:06 ` [PATCH v2 01/16] thermal/core: Add a thermal zone 'devdata' accessor Daniel Lezcano
2023-02-21 18:20   ` Jernej Škrabec
2023-02-22 19:19   ` Rafael J. Wysocki
2023-02-22 19:20   ` Florian Fainelli
2023-02-21 18:06 ` [PATCH v2 02/16] thermal/core: Show a debug message when get_temp() fails Daniel Lezcano
2023-02-22 19:25   ` Rafael J. Wysocki
2023-02-21 18:06 ` [PATCH v2 03/16] thermal: Remove debug or error messages in get_temp() ops Daniel Lezcano
2023-02-22 19:23   ` Florian Fainelli
2023-02-21 18:06 ` [PATCH v2 04/16] thermal/hwmon: Do not set no_hwmon before calling thermal_add_hwmon_sysfs() Daniel Lezcano
2023-02-22 19:23   ` Florian Fainelli
2023-02-21 18:06 ` [PATCH v2 05/16] thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs() Daniel Lezcano
2023-02-21 18:22   ` Jernej Škrabec
2023-02-22  9:31   ` AngeloGioacchino Del Regno
2023-02-21 18:07 ` [PATCH v2 06/16] thermal: Don't use 'device' internal thermal zone structure field Daniel Lezcano
2023-02-22  9:31   ` AngeloGioacchino Del Regno
2023-02-22 19:43   ` Rafael J. Wysocki
2023-02-22 20:00     ` Daniel Lezcano
2023-02-22 20:06       ` Rafael J. Wysocki
2023-02-23  9:56         ` Daniel Lezcano [this message]
2023-02-23 11:43           ` Rafael J. Wysocki
2023-02-23 14:35             ` Daniel Lezcano
2023-02-21 18:07 ` [PATCH v2 07/16] thermal/drivers/spear: Don't use tz->device but pdev->dev Daniel Lezcano
2023-02-21 18:07 ` [PATCH v2 08/16] thermal: Add a thermal zone id accessor Daniel Lezcano
2023-02-22 19:45   ` Rafael J. Wysocki
2023-02-21 18:07 ` [PATCH v2 09/16] thermal: Do not access 'type' field, use the tz id instead Daniel Lezcano
2023-02-22  9:31   ` AngeloGioacchino Del Regno
2023-02-22 19:47   ` Rafael J. Wysocki
2023-02-21 18:07 ` [PATCH v2 10/16] thermal/drivers/da9062: Don't access the thermal zone device fields Daniel Lezcano
2023-02-21 18:07 ` [PATCH v2 11/16] thermal/hwmon: Use the thermal_core.h header Daniel Lezcano
2023-02-21 18:37   ` Guenter Roeck
2023-02-21 18:07 ` [PATCH v2 12/16] thermal/drivers/tegra: Remove unneeded lock when setting a trip point Daniel Lezcano
2023-02-21 18:07 ` [PATCH v2 13/16] thermal/tegra: Do not enable the thermal zone, it is already enabled Daniel Lezcano
2023-02-21 18:07 ` [PATCH v2 14/16] thermal/drivers/acerhdf: Make interval setting only at module load time Daniel Lezcano
2023-02-21 20:07   ` Hans de Goede
2023-02-21 18:07 ` [PATCH v2 15/16] thermal/drivers/acerhdf: Remove pointless governor test Daniel Lezcano
2023-02-21 20:07   ` Hans de Goede
2023-02-21 18:07 ` [PATCH v2 16/16] thermal/traces: Replace the thermal zone structure parameter with the field value Daniel Lezcano
2023-02-22 19:51   ` Rafael J. Wysocki
2023-02-22 20:02     ` Daniel Lezcano
2023-02-22 20:07       ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b843912-cc9b-f1ac-1f81-28e3ecf8daba@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amitk@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bchihi@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=edubezval@gmail.com \
    --cc=festevam@gmail.com \
    --cc=idosch@nvidia.com \
    --cc=j-keerthy@ti.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).