Skip to content

pwm-regulator with voltage table problem

George Stark linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1regulator: core: add warning for not-recoverable statedrivers/regulator/core.c+4 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] pwm-regulator with voltage table problem

Here is the situation we've met on an ARM SoC:

We have an ARM SoC with dedicated power input for CPU core and supports different CPU clocks. CPU core power is supplied by external regulator, it's controlled by PWM channel from the SoC. DTS has node for pwm-regulator with voltage table (voltage table is used instead of range apparently to use only fine-tuned duty-cycle values) and with boot-on and always-on properties. This regulator is bound to cpu node. The pwm-regulator is inited at very early stage before bootloader in vendor closed-source code.

When a pwm-regulator is probed in the kernel it gets pwm current state and search voltage table by dutycycle to figure out the current voltage. If that search failed then the regulator goes to notrecoverbale state and the core sets the minimal power for the regulator.

The situation: bootloader sets mean cpu power and mean cpu clock.
but that cpu power is not found in the voltage table (value is between table items) due to different versions of bootloader and kernel and the regulator core sets the minimal power but cpu clock stays the same. CPU hangs somewhere during boot.

The core problem as I see it is if regulator is bound to CPU (or some other complex consumer) it can't be changed except by the consumer at any stage. So the regulator driver (core part) should wait for the own consumer to init it properly but regulator can't be in unknown state after probing.

What you think? The least should be done is to report about the situation.

George Stark (1):
regulator: core: add warning for not-recoverable state

 drivers/regulator/core.c | 4 ++++
 1 file changed, 4 insertions(+)

--
2.25.1