linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Benjamin Li <benl@squareup.com>
Cc: Amit Kucheria <amitk@kernel.org>,
	Thara Gopinath <thara.gopinath@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Zac Crosby <zac@squareup.com>, Andy Gross <agross@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] drivers: thermal: tsens: respect thermal_device_mode in threshold irq reporting
Date: Fri, 25 Feb 2022 18:41:42 +0100	[thread overview]
Message-ID: <3abfc379-d353-6caf-0cf0-83559a460be6@linaro.org> (raw)
In-Reply-To: <CACOsgWZ7KFSqC21sSq7hGYk_g2RoKTPPfoYQwcWmwCNSx5c-YQ@mail.gmail.com>

On 25/02/2022 17:46, Benjamin Li wrote:
> On Fri, Feb 25, 2022 at 6:02 AM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>> Some drivers that support thermal zone disabling implement a set_mode
>>> operation and simply disable the sensor or the relevant IRQ(s), so they
>>> actually don't log anything when zones are disabled. These drivers are
>>> imx_thermal.c, intel_quark_dts_thermal.c, and int3400_thermal.c.
>>>
>>> For tsens.c, implementing a change_mode would require migrating the driver
>>> from devm_thermal_zone_of_sensor_register to thermal_zone_device_register
>>> (or updating thermal_of.c to add a change_mode operation in thermal_zone_
>>> of_device_ops).
>>>
>>> stm_thermal.c seems to use this patch's model of not disabling IRQs when
>>> the zone is disabled (they still perform the thermal_zone_device_update
>>> upon IRQ, but return -EAGAIN from their get_temp).
>>
>> What is the concern by changing the core code to have a correct handling
>> of the disabled / enabled state in this driver ? (and by this way give
>> the opportunity to other drivers to fix their code)'
> 
> It seems fine, is that the preference? Updating thermal_of.c to add a
> change_mode
> operation in thermal_zone_of_device_ops?

I'm not a big fan of this duplicated ops structure but preferably it 
would be better to put it there (except if you see a better way to do 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:[~2022-02-25 17:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 20:01 [PATCH v3] drivers: thermal: tsens: respect thermal_device_mode in threshold irq reporting Benjamin Li
2022-02-25 14:02 ` Daniel Lezcano
2022-02-25 16:46   ` Benjamin Li
2022-02-25 17:41     ` Daniel Lezcano [this message]

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=3abfc379-d353-6caf-0cf0-83559a460be6@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=agross@kernel.org \
    --cc=amitk@kernel.org \
    --cc=benl@squareup.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=thara.gopinath@linaro.org \
    --cc=zac@squareup.com \
    /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).