From: Krzysztof Kozlowski <krzk@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: "André Draszik" <andre.draszik@linaro.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Michael Walle" <mwalle@kernel.org>,
"Peter Griffin" <peter.griffin@linaro.org>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
"Will McVicker" <willmcvicker@google.com>,
kernel-team@android.com, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] regulator: max20339: add Maxim MAX20339 regulator driver
Date: Tue, 17 Sep 2024 18:55:12 +0200 [thread overview]
Message-ID: <b0cd6a5c-9dc2-4ca6-a526-104788edf581@kernel.org> (raw)
In-Reply-To: <ZulFBQzRdOdw9cfV@finisterre.sirena.org.uk>
On 17/09/2024 10:59, Mark Brown wrote:
> On Mon, Sep 16, 2024 at 10:06:37PM +0200, Krzysztof Kozlowski wrote:
>> On 16/09/2024 18:48, André Draszik wrote:
>
>>> + /* INSW status */
>>> + if ((status[3] & MAX20339_VINVALID)
>>> + && !(status[0] & MAX20339_VINVALID)) {
>>> + dev_warn(dev, "Vin over- or undervoltage\n");
>
>> Same with all these. What happens if interrupt is triggered constantly?
>
> Logs on physical error conditions are a lot more appropriate than debug
> logs, they should basically never be triggered in normal operation and
> often it's a priorty to get information out about a failure in case
> someone might actually see something going wrong - especially with
> regulators, the system might be about to fall over if we're failing to
> regulate except in cases like SD cards. However in the case of the
> regulator API where you're telling the core about the error it's good to
> defer this to the core. We should probably be doing a better job here
> and logging something in the core.
In any case, this probably should be dev_warn_ratelimited.
>
>>> + if (val & MAX20339_LSWxSHORTFAULT)
>>> + *flags |= REGULATOR_ERROR_OVER_CURRENT;
>>> +
>>> + if (val & MAX20339_LSWxOVFAULT)
>>> + *flags |= REGULATOR_ERROR_OVER_VOLTAGE_WARN;
>>> +
>>> + if (val & MAX20339_LSWxOCFAULT)
>>> + *flags |= REGULATOR_ERROR_OVER_CURRENT;
>
> These should be notified to the core too, especially over voltage.
>
>>> + irq_flags = IRQF_ONESHOT | IRQF_SHARED;
>
>> Why shared?
>
> Why not? In general if a driver can support a shared interrupt it's
> polite for it to do so.
I explained why not further down the context: because with devm it can
cause resource release issues. I also poke if person added it on
purpose, thus knows the answer "why", or just copied whatever code was
somewhere.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-09-17 16:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 16:48 [PATCH 0/2] Maxim MAX20339 regulator driver André Draszik
2024-09-16 16:48 ` [PATCH 1/2] dt-bindings: regulator: add max20339 binding André Draszik
2024-09-16 19:53 ` Peter Griffin
2024-09-17 5:15 ` André Draszik
2024-09-16 19:56 ` Krzysztof Kozlowski
2024-09-17 6:17 ` André Draszik
2024-09-16 16:48 ` [PATCH 2/2] regulator: max20339: add Maxim MAX20339 regulator driver André Draszik
2024-09-16 20:06 ` Krzysztof Kozlowski
2024-09-17 8:03 ` André Draszik
2024-09-17 8:15 ` Krzysztof Kozlowski
2024-09-17 8:16 ` Krzysztof Kozlowski
2024-09-17 8:59 ` Mark Brown
2024-09-17 16:55 ` Krzysztof Kozlowski [this message]
2024-09-17 9:19 ` Mark Brown
2024-09-17 11:41 ` André Draszik
2024-09-18 8:49 ` Mark Brown
2024-09-20 7:23 ` kernel test robot
2024-09-20 16:28 ` kernel test robot
2024-09-16 17:01 ` [PATCH 0/2] " André Draszik
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=b0cd6a5c-9dc2-4ca6-a526-104788edf581@kernel.org \
--to=krzk@kernel.org \
--cc=andre.draszik@linaro.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel-team@android.com \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mwalle@kernel.org \
--cc=peter.griffin@linaro.org \
--cc=robh@kernel.org \
--cc=tudor.ambarus@linaro.org \
--cc=willmcvicker@google.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).