mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>,
	linux-kernel@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH 2/2] regulator: pwm-regulator: Revert "Add validity checks in continuous .get_voltage"
Date: Sat, 7 Nov 2026 12:25:56 +0000	[thread overview]
Message-ID: <0264fb70-4c57-4e6d-a02e-677e1f9077ed@sirena.org.uk> (raw)
In-Reply-To: <CAFBinCCN+P0YRvOP9pwmxVXGv-MGyuZn_45nCZ-7ko8Ko3v+-A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1729 bytes --]

On Fri, Nov 06, 2026 at 10:45:31PM +0100, Martin Blumenstingl wrote:
> On Fri, Nov 6, 2026 at 2:46 PM Mark Brown <broonie@kernel.org> wrote:
> > On Fri, Nov 06, 2026 at 01:59:56PM +0100, Mike Looijmans wrote:

> > > The core, and in particular the machine_constraints_voltage() method,
> > > expects the regulator to report what the current setting is, even if that
> > > is outside the allowed range. The core will then bring the voltage into
> > > that range. It cannot do that if the regulator refuses to return its
> > > setting, and causes probe() to fail for a pwm-regulator when it has
> > > restrictions to the PWM range with messages like:

...

> > > Besides that, regulator_get_voltage() is not supposed to return any
> > > state information, as is mentioned in the API documentation.
> according to include/linux/regulator/driver.h:

>  * @get_voltage: Return the currently configured voltage for the regulator;
>  *                   return -ENOTRECOVERABLE if regulator can't be read at
>  *                   bootup and hasn't been set yet.

> Can you please specify which API documentation you are referring to?

> I believe back when this change was authored it didn't make a
> difference on my board (but made sense based on review feedback).
> So I'm not against reverting as long as we have a proper explanation
> why the original patch is incorrect.

The PWM driver is a bit weird here since everything is very software
defined.  If the regulator is disabled and the state that the software
will apply on enable is known then it should return a value, if we have
no idea what the hardware will do on enable then we can't safely say
what the value that will be provided is.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-11-07 12:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.44efb263-5265-4fae-9cff-e8eaefbc0afd@emailsignatures365.codetwo.com>
2026-11-06 12:59 ` [PATCH 1/2] regulator: pwm-regulator: Revert "Calculate the output voltage for disabled PWMs" Mike Looijmans
     [not found]   ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.6954786b-65e0-4206-a0c4-60cd251dbec9@emailsignatures365.codetwo.com>
2026-11-06 12:59     ` [PATCH 2/2] regulator: pwm-regulator: Revert "Add validity checks in continuous .get_voltage" Mike Looijmans
2026-11-06 13:37       ` Mark Brown
2026-11-06 21:45         ` Martin Blumenstingl
2026-11-07 12:25           ` Mark Brown [this message]
2026-11-09  6:34           ` Mike Looijmans
2026-11-08 15:13       ` Mark Brown
2026-11-09  6:22         ` Mike Looijmans
2026-11-06 13:36   ` [PATCH 1/2] regulator: pwm-regulator: Revert "Calculate the output voltage for disabled PWMs" Mark Brown
2026-11-06 13:56     ` Mike Looijmans
2026-11-06 21:57     ` Martin Blumenstingl
2026-11-09  6:09       ` Mike Looijmans

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=0264fb70-4c57-4e6d-a02e-677e1f9077ed@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mike.looijmans@topic.nl \
    /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

all inboxes | Powered by JetHome®