Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>, Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] hwmon: chipcap2: disable sensor if request ready irq fails
Date: Mon, 12 Aug 2024 22:48:06 +0200	[thread overview]
Message-ID: <f6034baa-3a1c-4bd3-8cf2-cd197e8a0945@gmail.com> (raw)
In-Reply-To: <eefbeda1-8c09-4b57-83dc-30be9966de2b@roeck-us.net>

On 12/08/2024 22:08, Guenter Roeck wrote:
> On 8/12/24 12:59, Javier Carrasco wrote:
>> On 12/08/2024 18:49, Guenter Roeck wrote:
>>> On 8/12/24 08:43, Javier Carrasco wrote:
>>>> This check is carried out after getting the regulator, and the device
>>>> can be disabled if an error occurs.
>>>>
>>>
>>> I do not see a possible path for a call to cc2_enable() at this point,
>>> meaning the regulator won't ever be enabled. Please provide a better
>>> explanation why this patch would be necessary.
>>>
>>> Guenter
>>>
>>
>> Hi Guenter,
>>
>> this patch enforces the state where the dedicated regulator is disabled,
>> no matter what the history of the regulator was. If a previous
>> regulator_disable() failed, it would still be desirable that the
>> regulator gets disabled the next time the driver is probed (i.e. a new
>> attempt to disable it on failure).
>> cc2_disable() checks first if the regulator is enabled to avoid any
>> imbalance.
>>
> 
> That is very theoretic. Sorry, I am not going to accept this patch.
> 
> Guenter
> 

I get your point, but given that this device requires a dedicated
regulator, I believe it makes sense that it tries to disable it whenever
possible if it's not going to be used. I think that makes more sense
that just returning an error value without even making sure that de
regulator was disabled, doesn't it?

Of course this is not a killer feature, and I don't want to make you
waste much time with it. But I think the dedicated regulator should be
shut down in all error paths, whatever status it had before.

If that does not sound convincing, then I won't argue any longer. Please
take a look at the first patch of the series in any case, which is not a
killer feature either, but cleaner than the current implementation.

Thanks and best regards,
Javier Carrasco

  reply	other threads:[~2024-08-12 20:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12 15:43 [PATCH 0/2] hwmon: chipcap2: small improvements in probe function Javier Carrasco
2024-08-12 15:43 ` [PATCH 1/2] hwmon: chipcap2: return dev_err_probe if get regulator fails Javier Carrasco
2024-08-12 15:43 ` [PATCH 2/2] hwmon: chipcap2: disable sensor if request ready irq fails Javier Carrasco
2024-08-12 16:49   ` Guenter Roeck
2024-08-12 19:59     ` Javier Carrasco
2024-08-12 20:08       ` Guenter Roeck
2024-08-12 20:48         ` Javier Carrasco [this message]
2024-08-12 21:26           ` Guenter Roeck
2024-08-12 22:04             ` Javier Carrasco

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=f6034baa-3a1c-4bd3-8cf2-cd197e8a0945@gmail.com \
    --to=javier.carrasco.cruz@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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