RohmSemiconductor / Linux-Kernel-PMIC-Drivers

Rohm power management IC drivers for Linux kernel.
2 stars 3 forks source link

BD71828: BD71879: Voltage setting for Low-power states is faulty #17

Closed M-Vaittinen closed 5 months ago

M-Vaittinen commented 5 months ago

PROBLEM:

A few of the regulators on BD71828 / BD71879 do have common voltage setting for some or all of the power states (RUN, IDLE, SUSPEND, LSPR). The driver supports setting voltages for low-power states via device-tree. At driver probe time the device-tree is read for these voltage settings, and found voltage is written to the hardware.

When this is done for a regulator where same voltage is used in all/many states, this will set voltage also for states which were not intended to be changed. It means the board device-tree writer needs to be aware of this behaviour or nasty problems may emerge when voltage configuration is accidentally changed. Problems may vary from changing the currently used voltage to some low-power state voltage (which may cause problems to the hardware) - to setting wrong voltage(s) for low-power states which can lead to increased power consumption or even hardware damage.

FIX:

The fix is to only allow power-state specific voltage setting for those regulators where it is supported per state. We can still allow using the special voltage values like '0' to mark regulator to be disabled at specific low-power state. This is supported for all states at least on all BUCK regulators.

M-Vaittinen commented 5 months ago

Fixed by: https://lore.kernel.org/all/e1883ae1e3ae5668f1030455d4750923561f3d68.1715848512.git.mazziesaccount@gmail.com/

Applied to regulator tree for-next branch https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git