[PATCH v2 3/5] power: regulator: Exit from regulator_set_suspend_value on poorly described regulators

Marek Vasut marex at denx.de
Wed Sep 25 13:23:46 CEST 2024


On 9/25/24 8:29 AM, Jonas Karlman wrote:
> Hi Marek,

Hi,

> On 2024-09-25 04:21, Marek Vasut wrote:
>> In case the DT regulator node does not contain 'regulator-max-microvolt'
>> property and does not contain 'regulator-state-mem' subnode (like the
>> test.dts regul1_scmi: reg at 1 {} regulator node), then regulator_pre_probe()
>> will parse this regulator node and set uc_pdata->suspend_on = true and
>> uc_pdata->suspend_uV = uc_pdata->max_uV, where uc_pdata->max_uV is set
>> to -ENODATA because "regulator-max-microvolt" is missing, and therefore
>> uc_pdata->suspend_uV is also -ENODATA. In case regulator_autoset() is
>> used afterward, it will attempt to call regulator_set_suspend_value()
>> with uV = uc_pdata->suspend_uV = -ENODATA and fail with -EINVAL. Check
>> for this case in regulator_set_suspend_value() and immediately return 0,
>> because there is no way to set meaningful suspend voltage, so do nothing
>> and retain the existing settings of the regulator.
> 
> I sent a different fix for this some time ago, please check it out:
> 
> https://patchwork.ozlabs.org/patch/1964571/
That one will work too, yes.


More information about the U-Boot mailing list