From: Mark Brown <broonie@kernel.org>
To: Andreas Kemnade <akemnade@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] regulator: core: fix constraints handling if current state out of range
Date: Tue, 4 Nov 2025 13:52:11 +0000 [thread overview]
Message-ID: <aQoFC3YDNlw4imML@finisterre.sirena.org.uk> (raw)
In-Reply-To: <20251103-regu-fix-v1-1-c8a46581c850@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]
On Mon, Nov 03, 2025 at 08:32:41PM +0100, Andreas Kemnade wrote:
> - if (current_uV < rdev->constraints->min_uV) {
> + if ((current_uV < rdev->constraints->min_uV) ||
> + (current_uV > rdev->constraints->max_uV)) {
> target_min = rdev->constraints->min_uV;
> - target_max = rdev->constraints->min_uV;
> - }
> -
> - if (current_uV > rdev->constraints->max_uV) {
> - target_min = rdev->constraints->max_uV;
> target_max = rdev->constraints->max_uV;
> }
There's a valid issue here if we can't represent the exact constraint
(the hope was that people wouldn't specify constraints that their
hardware wasn't capable of representing but we can't exactly stop
them...) however this change is risky in the case where the voltage is
too high since if we specify a range from minimum to maximum we'll try
to select a voltage as close as possible to the minimum. That could
result in a large change if the range is wide, and potentially go under
the voltage the hardware needs for it's current configuration. We were
trying to set the highest voltage in the range to minimise the risk
there. This isn't a concern in the case where we're raising the
voltage.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-11-04 13:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 19:32 Andreas Kemnade
2025-11-04 13:52 ` Mark Brown [this message]
2025-11-05 9:08 ` Andreas Kemnade
2025-11-05 11:48 ` Mark Brown
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=aQoFC3YDNlw4imML@finisterre.sirena.org.uk \
--to=broonie@kernel.org \
--cc=akemnade@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®