diff options
| author | Donggeun Yoo <donggeunyoo.kernel@gmail.com> | 2026-09-03 17:20:09 +0900 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-09-03 22:22:36 +0100 |
| commit | f0c54cc56a9a21047b1afa209baea8ea931f2e92 (patch) | |
| tree | 0706eaf960d9e0c5630b14d5d2e0c22b25a3ad72 /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | f7396c2dbbc1bed6c2c554d1ddf80d16e4780a7d (diff) | |
regulator: pf1550: fix division by zero in the ramp rate selection
set_machine_constraints() calls the set_ramp_delay() op when either
constraints->ramp_delay or constraints->ramp_disable is set. The
regulator binding documents regulator-ramp-delay = <0> as the way to
disable ramp control, and of_get_regulation_constraints() turns that
into ramp_disable = true while leaving ramp_delay at 0, so the op is
called with a ramp_delay of 0. The range check rejects negative values
and values above 6250 but not zero, and the value is then used as a
divisor.
The mapping is also wrong for the values that do pass the check. The
hardware offers two rates, 6250 uV/us and 3125 uV/us, selected by
SWx_DVSSPEED in SWx_CTRL1. Dividing 6250 by the requested rate and
taking bit 1 of the quotient does not map monotonically onto them: a
request for 1500 uV/us selects 6250 uV/us, while a request for the
faster 2000 uV/us selects 3125 uV/us.
Replace the division with a direct mapping onto the two supported
rates. Requests at or below 3125 uV/us get the slower rate and anything
above it gets the faster one. A ramp_delay of 0 asks for ramp control
to be disabled, which this hardware cannot do, so it gets the fastest
rate; pfuze100 handles the disabled case the same way.
Fixes: 7320d41c29bb ("regulator: pf1550: Add support for regulator")
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Link: https://patch.msgid.link/20260903082010.4024603-1-donggeunyoo.kernel@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions
